Ruby on Rails Wednesday, December 15, 2010

Just another quick question if you don't mind.

I'm trying to manually append a SafetyOfficer to the Timesheet with the
Rails console:

Incident.first.timesheet.safety_officer << SafetyOfficer.last

NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.<<


I searching for a solution but can't find anything. Do you know what
this error message means? All the fields in SafetyOfficer.last are
correct, and 'timesheet_id' is nil.

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment