Skip to content

Instantly share code, notes, and snippets.

@nakajima
Created July 22, 2008 15:45
Show Gist options
  • Select an option

  • Save nakajima/1096 to your computer and use it in GitHub Desktop.

Select an option

Save nakajima/1096 to your computer and use it in GitHub Desktop.
module WithScopes
def with_scopes(*named_scopes)
named_scopes.inject(self) { |klass, scope| klass.send(scope) }
end
end
ActiveRecord::Base.extend(WithScopes)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment