Displaying 1 result from an estimated 1 matches for "that_fly".
Did you mean:
that_file
2006 Aug 17
2
find method not interpreting arguments correctly?
...uments from a method
to find and AR is telling me that it can''t find the record where
id=all
here''s what i am attempting to do
class Thing < ActiveRecord::Base
belongs_to :x
end
class FlyingThing < Thing
end
class x < ActiveRecord::Base
has_many :things do
def that_fly(*args)
FlyingThing.find(args)
end
end
end
so if i were to do
x.find(:first).things.that_fly(:all)
i get
ActiveRecord::RecordNotFound: Couldn''t find FlyingThing with ID=all
is this a bug or am i doing something wrong?
Chris