Association Extensions and Conditions

Hey,

I’m wondering whether the following ‘should’ work, but I’m just not
getting it right.

I have the following association on my model:

has_many :things do
def cool
find(:all, :conditions => { :cool => true })
end
end

Now, I want to be able to do the following:

Suitcase.things.find(:all, :conditions => { :date => Date.today }).cool

I get an error that Array does not have a ‘cool’ method.

Any ideas?

Thanks
Joerg

I forgot to add that

Suitcase.things.cool

works though. Just not if I combine it with an additional find.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs