Displaying 1 result from an estimated 1 matches for "test_second".
2006 Aug 14
0
Save fails due to HATBM relationship... but only if not saved before?
...alid
from
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/validations.rb:748:in
`save!''
from (irb):3
However, if I save the new Group object first, then assign the manager, then
save again, then it works:
>> @group = Group.new(:name => ''test_second'')
=> #<Group:0x40b75b08>
>> @group.save!
=> true
>> @group.managers << User.find(1)
=> [#<User:0x40b55830>]
>> @group.save!
=> true
What could be causing this? Has anybody ran into this problem before?
Thanks!
--
View this message in cont...