Skip to content

Instantly share code, notes, and snippets.

@timlinquist
Created January 14, 2011 10:05
Show Gist options
  • Save timlinquist/779436 to your computer and use it in GitHub Desktop.
Save timlinquist/779436 to your computer and use it in GitHub Desktop.
Calling scope from within another scope
named_scope :job_titles, lambda { |ut| { :conditions => { :user_type => ut } }}
named_scope :search_analysts, lambda { job_titles('Search Analyst') }
named_scope :marketing_analysts, lambda { job_titles('Marketing Analyst') }
named_scope :seo_specialists, lambda { job_titles('Link Specialist') }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment