treybomb-j3K/hMlcnbFeoWH0uzbU5w@public.gmane.org
2006-Oct-01 00:26 UTC
Instantiating a Derived Class from an Instance of Base Class
I''ve got a ''Task'' base class and a ''ScheduledTask'' derived class that I''m currently using with single table inheritance. I''m trying to create a new ScheduledTask instance from an existing Task instance: scheduled_task = ScheduledTask.new(task) but I get a NoMethodError: undefined method `stringify_keys!'' for #<Task:0x395d2a8>. I can get around this if I just instantiate a "blank" ScheduledTask (.new) and manually fill in all of the shared attributes, but I know there''s gotta be an easier way. Please advise. Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Trevor Scott
2006-Oct-02 14:22 UTC
Re: Instantiating a Derived Class from an Instance of Base Class
bump --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---