gayle / two_tents

[If you start working on an issue, please assign it to yourself so others know that issue is in progress.] - [If you finish an issue, please tag it Fixed so that user acceptance testing can be performed. The issue will be closed by the tester.]
14 stars 6 forks source link

Error adding existing participant to new family #168

Open gayle opened 11 years ago

gayle commented 11 years ago

Error on screen says "undefined method `familyname' for nil:NilClass" but that's an error that comes from trying to display an informative error message.

The root problem is that in families_controller.rb > create(), this line is throwing an exception (I'm not sure why the stack trace isn't showing that anymore, but I copied and pasted what was there)

@family = Family.new(params[:family])

EXCEPTION:
ActiveRecord::RecordNotFound Exception: Couldn't find Participant with ID=101 for Family with ID=
C:/Ruby187. p370/lib/ruby/gems/1.8/gems/activerecord-2.3.16/lib/active_record/nested_attributes.rb:401:in raise_nested_attributes_record_not_f ound'<br />C:/Ruby187.p370/lib/ruby/gems/1.8/gems/activerecord-2.3.16/lib/active_record/nested_attributes.rb:363:inassignnested attributes_for_collection_association' BACTRACE: C:/Ruby187.p370/lib/ruby/gems/1.8/gems/activerecord-2.3.16/lib/active_record/nested_attributes.rb:401:in raise_nested_a ttributes_record_not_found' C:/Ruby187.p370/lib/ruby/gems/1.8/gems/activerecord-2.3.16/lib/active_record/nested_attributes.rb:363:inassign_nested_att ributes_for_collection_association' C:/Ruby187.p370/lib/ruby/gems/1.8/gems/activerecord-2.3.16/lib/active_record/nested_attributes.rb:352:in each' C:/Ruby187.p370/lib/ruby/gems/1.8/gems/activerecord-2.3.16/lib/active_record/nested_attributes.rb:352:inassign_nested_att ributes_for_collection_association' C:/Ruby187.p370/lib/ruby/gems/1.8/gems/activerecord-2.3.16/lib/active_record/nested_attributes.rb:244:in `participants_attr

gayle commented 11 years ago

This is not a prod bug, only happens locally. So some change recently has caused this problem. Argh.

gayle commented 11 years ago

This is also a problem with creating a new family. Seems to be any time saving w/ nested attributes, it doesn't like it anymore.

gayle commented 11 years ago

When I revert to rails 2.3.9 the error also goes away. Rails 2.3.16 has the problem. (Doesn't seem to have a problem with the change from Sqlite to Postgres)

gayle commented 11 years ago

2.3.10 and up does not work. 2.3.9 still works. Sticking w/ that for now.