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.
This commit is contained in:
Jared Luxenberg 2012-08-04 17:31:56 -07:00
parent f74bd2fbbd
commit e12f9c4951
4 changed files with 15 additions and 2 deletions

View file

@ -10,4 +10,8 @@ end
Factory.define :topic do |m|
m.sequence(:title){ |n| "Title #{n}"}
m.sequence(:author_name){ |n| "Author #{n}"}
end
end
Factory.define :widget do |m|
m.sequence(:w_id){ |n| n}
end