That's the polymorphic bit.  when you declare it polymorphic and use
the appropriate :as => ... it tells rails to look for the id and type
when doing association calls.  pretty much automagic by rails itself.
nothing special from hobo on the model side.  the code I added
basically handles the view addition to any model declaring that it
has_many :comments

On Jul 30, 8:20 am, Nicolas Oury <[email protected]> wrote:
> On Fri, Jul 30, 2010 at 2:53 PM, Matt Jones <[email protected]> wrote:
> > Note that .new doesn't actually add a database row, it just
> > creates an in-memory object that could eventually *become* a database
> > row (if you called save on it).
>
> I understand that.
>
> I am mainly wondering where and how the magic happens for
> commentable_id and commentable_type?
> It does not seem to be set anywhere...
>
> best regards,
>
> Nicolas

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en.

Reply via email to