Is there a way to combine named scopes into a new named scope?
I have class Foo < ActiveRecord::Base named_scope :a, lambda { |a| :conditions => { :a => a } } named_scope :b, lambda { |b| :conditions => { :b => b } } end I'd like class Foo < ActiveRecord::Base named_scope :ab, lambda { |a,b| :conditions => { :a => a, :b => b } } end but I'd prefer to do it in a DRY fashion. I can get the same effect by using Foo.a(something).b(something_else) but it's not particularly lovely. Well I'm still new to rails and I'm not sure exactly what you're going for here, but if you're just going for code reuse why not use a regular class method? def self.ab(a, b) a(a).b