Topic: Refactor multiple scopes

This is my working code, but I cant figure out how to clean this up and maybe is the other Rails Way to do this?

  
  #model
    scope :confirmed_ads, :conditions => ["advertiser_id IS NOT NULL"]
    scope :unconfirmed_ads, :conditions => ["advertiser_id IS NULL"]
    scope :unverified_ads, :conditions => ["advertiser_id IS NOT NULL AND verification_date IS NOT NULL"]
    scope :ads_by_user, lambda { |email| { :conditions => ["email = ?", email ] } }
     
    def self.with_some_scope(scope_name, email)
    case scope_name
      when 'unverified_ads'
       self.unverified_ads
      when 'unconfirmed_ads'
       self.unconfirmed_ads
      when 'confirmed_ads'
       self.confirmed_ads
      when 'ads_by_user'
       self.ads_by_user(email)
      else
        #domyslny scope
        self.unverified_ads
      end
    end
    #controller
    @ads = Ad.with_some_scope(params[:scope], params[:email])
    #view
    = link_to "Unconfirmed Ads", verifications_path(:scope => "unconfirmed_ads")
    ...
    = link_to "#{ad.name}", verifications_path(:scope => "ads_by_user", :email => ad.email) 

Re: Refactor multiple scopes

I think it would be better to remove with_some_scope method and use in controller like:
Ad.send(params[:scope], params[:email])
It will do the same logic except if scope was not found, but I think it is exceptional case.

Re: Refactor multiple scopes

Or at least you can remove case there:
def self.with_some_scope(scope_name, email)
  if self.methods.include?(scope_name)
    self.send(scope_name, email)
  else
    self. unverified_ads
  end
end