# Composed\_of no longer works with Rail 2.02

**URL:** <https://www.ruby-forum.com/t/composed-of-no-longer-works-with-rail-2-02/130754>\
**Category:** Rails\
**Created:** [March 3, 2008, 2:18am UTC](https://www.ruby-forum.com/t/composed-of-no-longer-works-with-rail-2-02/130754 "2008-03-03T02:18:23Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [March 3, 2008, 2:18am UTC](https://www.ruby-forum.com/t/composed-of-no-longer-works-with-rail-2-02/130754/1 "2008-03-03T02:18:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [March 3, 2008, 4:30am UTC](https://www.ruby-forum.com/t/composed-of-no-longer-works-with-rail-2-02/130754/2 "2008-03-03T04:30:43Z")

</div>

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 \<  
removed\_email\_address@domain.invalid\> wrote:

> `description’
> 
> ```
> from (irb):2
> 
> ```
> 
> ## Has anyone else encountered this problem?
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> >

–  
Ryan B.

> **[frozenplague.net](http://www.frozenplague.net)**
>
> This domain may be for sale!

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

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [March 3, 2008, 10:34am UTC](https://www.ruby-forum.com/t/composed-of-no-longer-works-with-rail-2-02/130754/3 "2008-03-03T10:34:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [March 15, 2008, 2:23pm UTC](https://www.ruby-forum.com/t/composed-of-no-longer-works-with-rail-2-02/130754/4 "2008-03-15T14:23:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![divotdave](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bbe5ce/32.png) [@divotdave](https://www.ruby-forum.com/u/divotdave)\
**Post date:** [March 7, 2008, 4:32am UTC](https://www.ruby-forum.com/t/composed-of-no-longer-works-with-rail-2-02/130754/5 "2008-03-07T04:32:37Z")

</div>

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 \<  
> removed\_email\_address@domain.invalid\> wrote:
> 
> > `description’
> > 
> > ```
> > from (irb):2
> > 
> > ```
> > 
> > ## Has anyone else encountered this problem?
> > 
> > Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> > 
> > >
> 
> –  
> Ryan B.  
> [http://www.frozenplague.net](http://www.frozenplague.net)  
> Feel free to add me to MSN and/or GTalk as this email.
