Skip to content

Instantly share code, notes, and snippets.

@leemcalilly
Created May 22, 2013 13:45
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 leemcalilly/5627636 to your computer and use it in GitHub Desktop.
Save leemcalilly/5627636 to your computer and use it in GitHub Desktop.
class User < ActiveRecord::Base
rolify
authenticates_with_sorcery!
attr_accessible :email, :password, :password_confirmation
email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, :presence => true,
:format => { :with => email_regex },
:uniqueness => { :case_sensitive => false }
validates :password, :presence => { :on => :create },
:confirmation => true
validates_length_of :password, :minimum => 6, :maximum => 40
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment