activerecord-import/test/support/factories.rb
Jared Luxenberg e12f9c4951 Model#import fails to find model's primary key sequence
Fixes a bug where Model#import does not work when a model's primary key
has no associated 'sequence' in the database. If a value for the primary
key is specified, then the insert should not require a database
'sequence' to generate a value for that primary key field.
2012-08-04 17:35:50 -07:00

18 lines
380 B
Ruby

Factory.define :group do |m|
m.sequence(:order) { |n| "Order #{n}" }
end
Factory.define :invalid_topic, :class => "Topic" do |m|
m.sequence(:title){ |n| "Title #{n}"}
m.author_name nil
end
Factory.define :topic do |m|
m.sequence(:title){ |n| "Title #{n}"}
m.sequence(:author_name){ |n| "Author #{n}"}
end
Factory.define :widget do |m|
m.sequence(:w_id){ |n| n}
end