On Oct 17, 12:14 am, Peter Vandenabeele <[email protected]>
wrote:
> I have always been curious why the format of the association methods
> is so different for the singular compared to collection associations. This
> then
> leads to confusion as shown above ...
>
> has_many => self.others.xxx (many methods added by has_many)
> has_one => self.{build|create}_other
>
> Maybe for the singular association, we could add
>
> self.other.build
> self.other.create
> self.other.create!
>
> to make it more uniform ?
>
> HTH,
>
> Peter
Has_one is very similar to has_many, in sense, but rails does a LIMIT
to 1 when we use has_one. In essence, its a good way to differentiate
that we are using has_one or has_many.
Thats my understanding and opinion.
Regards
Nikhil
--
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.