Skip to content

Instantly share code, notes, and snippets.

@Shinpeim
Created June 29, 2012 09:50
Show Gist options
  • Save Shinpeim/3016978 to your computer and use it in GitHub Desktop.
Save Shinpeim/3016978 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
attr_accessible :password, :user_id, :salt
has_many :articles
validates_presence_of :user_id, :password
def auth(password)
return self.password == password
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment