Skip to content

Instantly share code, notes, and snippets.

@ruprict
Created March 7, 2012 00:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruprict/1990156 to your computer and use it in GitHub Desktop.
Save ruprict/1990156 to your computer and use it in GitHub Desktop.
Mike Pack Solr Article
class Product < ActiveRecord::Base
validates :name, :color, :used, :presence => true
validates :name, :uniqueness => true
validates :used, :inclusion => {:in => [true, false]}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment