# Cannot list within associatiion: uninitialized constant

**URL:** <https://www.ruby-forum.com/t/cannot-list-within-associatiion-uninitialized-constant/138883>\
**Category:** Ferret\
**Created:** [May 28, 2008, 5:03pm UTC](https://www.ruby-forum.com/t/cannot-list-within-associatiion-uninitialized-constant/138883 "2008-05-28T17:03:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [May 28, 2008, 5:03pm UTC](https://www.ruby-forum.com/t/cannot-list-within-associatiion-uninitialized-constant/138883/1 "2008-05-28T17:03:42Z")

</div>

Testing ferret w a simple model, I don’t understand what happen…

class Domain \< ActiveRecord::Base  
has\_many :categories  
end

class Category \< ActiveRecord::Base  
has\_many :notices  
belongs\_to :domain  
end

class Notice \< ActiveRecord::Base  
belongs\_to :category  
acts\_as\_ferret :fields =\> [:name, :description, :requirements]  
end

I created the DB and tables …

ActiveRecord::Schema.define(:version =\> 3) do

create\_table “domains”, :force =\> true do |t|  
t.string “name”  
t.datetime “created\_at”  
t.datetime “updated\_at”  
end

create\_table “categories”, :force =\> true do |t|  
t.string “name”  
t.integer “code”  
t.integer “domain\_id”  
t.datetime “created\_at”  
t.datetime “updated\_at”  
end

create\_table “notices”, :force =\> true do |t|  
t.integer “category\_id”  
t.string “name”  
t.text “requirements”  
t.text “description”  
t.datetime “created\_at”  
t.datetime “updated\_at”  
end

end

but

> > Domain.find(:all)  
> > =\> []
> 
> > Category.find(:all)  
> > =\> []
> 
> > Notice.find(:all)  
> > NameError: uninitialized constant Notice

if I take out the acts\_as\_ferret in my Notice model  
#acts\_as\_ferret :fields =\> [:name, :description, :requirements]

> > Domain.find(:all)  
> > =\> []  
> > Category.find(:all)  
> > =\> []
> 
> > Notice.find(:all)  
> > =\> []

what’s the problem with acts\_as\_ferret ? am I missing any additional  
parameter ?

thanks for your lights !
