Skip to content

Instantly share code, notes, and snippets.

@igaiga
Created August 25, 2014 09:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igaiga/d87519d105977116fa08 to your computer and use it in GitHub Desktop.
Save igaiga/d87519d105977116fa08 to your computer and use it in GitHub Desktop.
class Category < ActiveRecord::Base
scope :name, ->(category) { where(name: category )}
end
Category.name("restaurants")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment