On 25 March 2011 17:15, Alexey M. <[email protected]> wrote: >>> It is just so natural to use the same primary key in this situation. >> >> Why? > > Well, it seems natural to me, and i often trust my senses :). > > I have been playing with it in console for a few minutes now and > observing some fun and weird behavior: > > i = Instructor.create > i.id # => 1 > i.person_id # => nil > Instructor.find(1) # => NoMethodError: undefined method `eq' for > nil:NilClass ... > i=Instructor.find_by_person_id(1) > i.id # => nil > i.person_id # => 1
This is some strange new use of the word fun, with which I am not familiar. Colin -- 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 [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

