app/models/user.rb in wheels-0.0.44 vs app/models/user.rb in wheels-0.0.45

- old
+ new

@@ -4,21 +4,11 @@ has_many :blogs, :dependent => :destroy has_one :profile, :dependent => :destroy has_many :galleries, :dependent => :destroy has_many :access_control_entries, :dependent=>:destroy - validates :email, :presence => true - def validates_password - class_eval do - attr_accessor :old_password - validates :old_password, :presence=>true , :password=>true - validates :password, :presence=>true , :length=>{:minimum=>6} - validates :password_confirmation, :equal_to=>{:other=>:password} - end - end - def self.nobody User.new(:role=>Role.nobody) end def self.root @@ -56,7 +46,15 @@ self.confirmed_at = DateTime::now save end devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable, :lockable, :timeoutable +end + +class FullyValidatedUser < User + attr_accessor :old_password + validates :email, :presence => true, :email => true + validates :old_password, :presence=>true , :password=>true + validates :password, :presence=>true , :length=>{:minimum=>6} + validates :password_confirmation, :equal_to=>{:other=>:password} end