no, it still work event your class is inherited more than one level

On Sep 21, 1:08 am, Matt Jones <[email protected]> wrote:
> On Sep 19, 7:33 am, robdoan <[email protected]> wrote:
>
> > As my knowledge, it should be :
>
> [snip]
> >    def userable_type=(sType)
> >        super(sType.to_s.classify.constantize.base_class.to_s)
> >     end
> > end
>
> Um, no. If you're needing to do this, you've done something seriously
> wrong. This is already supported by :polymorphic => true. Also note
> that your "solution" here will fail if the class associated to the
> table (Asset in this case) is more than one level above the class
> being stored (ie Asset > Sound > Mp3 will try to find records in a
> 'sounds' table => FAIL)
>
> --Matt Jones
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to