Quick response
Product.not_deleted.available(args.first)
- the named area itself, formed by the union of both named areas.
scope(:find) gets conditions for the named area (or combination of areas), which you, in turn, can use to create a new named area.
So, for example:
named_scope :active, :conditions => 'active = true'
named_scope :not_deleted, :conditions => 'deleted = false'
then you write
named_scope :active_and_not_deleted, :conditions => 'active = true and deleted = false'
or, you can write
named_scope :active_and_not_deleted, lambda { self.active.not_deleted.scope(:find) }
. , .
, () 3,
scope :active_and_not_deleted, active.not_deleted