Sha256: b70ed62bea3e38158fc15b3a17b6475cbfee13f2186eab254088c09636cee325

Contents?: true

Size: 359 Bytes

Versions: 2

Compression:

Stored size: 359 Bytes

Contents

FactoryBot.define do
  factory :<%= name %>, class: <%= record.class %> do
  <% columns.each do |column| %>
    <% quote = FactoryBotGenerator::Base::QUOTE_AROUND_VALUE_TYPES.include?(record.class.columns_hash[column].type) %>
    <%= "%-#{indent}s" % column %> <%== "'" if quote %><%== record.public_send(column) %><%== "'" if quote %>
  <% end %>
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
factory_bot_generator-0.2.2 lib/factory_bot_generator.erb
factory_bot_generator-0.2.1 lib/factory_bot_generator.erb