Composed_of no longer works with Rail 2.02

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?

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 <
[email protected]> wrote:

`description’

   from (irb):2

Has anyone else encountered this problem?

Posted via http://www.ruby-forum.com/.


Ryan B.

Feel free to add me to MSN and/or GTalk as this email.

On 3 Mar 2008, at 03:29, Ryan B. (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

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 C. wrote:

On 3 Mar 2008, at 03:29, Ryan B. (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

Attached is the complete stack trace and the aggregate class and model
code.

Thanks

Ryan B. 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 <
[email protected]> wrote:

`description’

   from (irb):2

Has anyone else encountered this problem?

Posted via http://www.ruby-forum.com/.


Ryan B.
http://www.frozenplague.net
Feel free to add me to MSN and/or GTalk as this email.