Re: Getting Valid ENUM Values in ActiveRecord

Aaron Baldwin
Sun, 10 Sep 2006 04:43:23 -0000

On Sep 9, 2006, at 4:54 PM, Guest wrote:

>
> The problem is that I have to explicitly call
''MyClass.table_name''.  I
> know I can use ''self.class'' to get the the name of the
class that I
> need.  However, how do I programmatically tell ruby to EXECUTE
''{The
> class who''s name is self.class}.table_name''?

I think you can just use:

self.class.table_name

Also, have you look at the Acts As Enumerated plugin.  It may solve
the problem you are working on, and even if it doesn''t the code it
will be give you an example of how to extend Active Record.

Aaron




--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---