I have
class Foo
has_many :widgets
end
There’s a place where I want to pull up all the widgets with a locked select. So, I want to do the equivalent of:
@widgets_to_work_with = Widget.find_all_by_foo_id(@foo.id, :lock => true)
With nicer code, something like:
@widgets_to_work_with = @foo.widgets(:lock => true)
What’s the best way to do this?
you could redefine the method widgets in Foo ActiveRecord or , safer ,add another method
a.e.
hope could be usefull