Skip to content

Instantly share code, notes, and snippets.

@jejacks0n
Created February 9, 2010 22:21
Show Gist options
  • Save jejacks0n/299756 to your computer and use it in GitHub Desktop.
Save jejacks0n/299756 to your computer and use it in GitHub Desktop.
module FilterableResource
def acts_as_filterable(options = {})
cattr_accessor :testing
self.testing = 'testing'
self.named_scope :filtered_from, lambda { |params|
puts('!!![' + self.testing.to_s + ']!!!')
nil
}
end
end
ActiveRecord::Base.extend FilterableResource
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment