I have
class Foo < ActiveRecord::Base named_scope :a, lambda { |a| :conditions => { :a => a } } named_scope :b, lambda { |b| :conditions => { :b => b } } end
I would like to
class Foo < ActiveRecord::Base named_scope :ab, lambda { |a,b| :conditions => { :a => a, :b => b } } end
but I would rather do it in a dry way. I can get the same effect using
Foo.a(something).b(something_else)
but it is not particularly nice.
ruby-on-rails
James A. Rosen
source share