I created a data aggregation using the activerecord composed_of method. It worked fine with rails 1.2.3 but after I recently upgraded to rails 2.0.2 I get the following error when I try to access it: NoMethodError: undefined method `constantize'' for EventDescription:Class from C:/Program Files/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/aggregations.rb:156:in `description'' from (irb):2 Has anyone else encountered this problem? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Show us the whole backtrace please. I think there''s something else going on at work here. I''m also interested in how you got that error as it seems like you''re calling a string method (constantize) on a class. On Mon, Mar 3, 2008 at 11:48 AM, David Harmon < rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I created a data aggregation using the activerecord composed_of method. > It worked fine with rails 1.2.3 but after I recently upgraded to rails > 2.0.2 I get the following error when I try to access it: > > NoMethodError: undefined method `constantize'' for EventDescription:Class > > from C:/Program > Files/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2 > /lib/active_record/aggregations.rb:156:in > `description'' > > from (irb):2 > > Has anyone else encountered this problem? > -- > Posted via http://www.ruby-forum.com/. > > > >-- Ryan Bigg http://www.frozenplague.net Feel free to add me to MSN and/or GTalk as this email. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
On 3 Mar 2008, at 03:29, Ryan Bigg (Radar) wrote:> Show us the whole backtrace please. I think there''s something else > going on at work here. I''m also interested in how you got that error > as it seems like you''re calling a string method (constantize) on a > class. >I''d guess that david is passing a class where he should be passing a class name Fred> On Mon, Mar 3, 2008 at 11:48 AM, David Harmon <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > > wrote: > > I created a data aggregation using the activerecord composed_of > method. > It worked fine with rails 1.2.3 but after I recently upgraded to rails > 2.0.2 I get the following error when I try to access it: > > NoMethodError: undefined method `constantize'' for > EventDescription:Class > > from C:/Program > Files/ruby/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/ > active_record/aggregations.rb:156:in > `description'' > > from (irb):2 > > Has anyone else encountered this problem? > -- > Posted via http://www.ruby-forum.com/. > > > > > > -- > Ryan Bigg > http://www.frozenplague.net > Feel free to add me to MSN and/or GTalk as this email. > >--~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Attached is the complete stack trace and the aggregate class and model code. Thanks Ryan Bigg wrote:> Show us the whole backtrace please. I think there''s something else going > on > at work here. I''m also interested in how you got that error as it seems > like > you''re calling a string method (constantize) on a class. > > On Mon, Mar 3, 2008 at 11:48 AM, David Harmon < > rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > >> `description'' >> >> from (irb):2 >> >> Has anyone else encountered this problem? >> -- >> Posted via http://www.ruby-forum.com/. >> >> > >> > > > -- > Ryan Bigg > http://www.frozenplague.net > Feel free to add me to MSN and/or GTalk as this email.Attachments: http://www.ruby-forum.com/attachment/1524/stack_trace.rtf -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks Your suggestion proved correct. I was not enclosing the class name in quotes in the class name option of the composed_of method. I do believe I was not enclosing the class name in quotes in version 1.2.3 and was able to get away with it. Frederick Cheung wrote:> On 3 Mar 2008, at 03:29, Ryan Bigg (Radar) wrote: > >> Show us the whole backtrace please. I think there''s something else >> going on at work here. I''m also interested in how you got that error >> as it seems like you''re calling a string method (constantize) on a >> class. >> > I''d guess that david is passing a class where he should be passing a > class name > > Fred-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---