0
include DataMapper::Resource
0
- include DataMapper::Validate
0
include AuthenticatedSystem::Model
0
attr_accessor :password, :password_confirmation
0
@@ -26,22 +25,22 @@ class User
0
property :remember_token, String
0
property :created_at, DateTime
0
property :updated_at, DateTime
0
- validates_length_of :login, :within => 3..40
0
- validates_uniqueness_of :login
0
- validates_presence_of :email
0
- validates_format_of :email, :as => :email_address
0
- validates_length_of :email, :within => 3..100
0
- validates_uniqueness_of :email
0
- validates_presence_of :password, :if => lambda { |r| r.password_required? }
0
- validates_presence_of :password_confirmation, :if => lambda { |r| r.password_required? }
0
- validates_length_of :password, :within => 4..40, :if => lambda { |r| r.password_required? }
0
- validates_confirmation_of :password#, :groups => :create
0
+ validates_length :login, :within => 3..40
0
+ validates_is_unique :login
0
+ validates_present :email
0
+ validates_format :email, :as => :email_address
0
+ validates_length :email, :within => 3..100
0
+ validates_is_unique :email
0
+ validates_present :password, :if => lambda { |r| r.password_required? }
0
+ validates_present :password_confirmation, :if => lambda { |r| r.password_required? }
0
+ validates_length :password, :within => 4..40, :if => lambda { |r| r.password_required? }
0
+ validates_is_confirmed :password#, :groups => :create
0
before :save, :encrypt_password
0
#before_class_method :create, :make_activation_code
0
#after_class_method :create, :send_signup_notification
0
@login = value.downcase unless value.nil?
Comments
No one has commented yet.