10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/devision/models/validatable.rb', line 10
def self.included(base)
base.extend(ClassMethods)
base.class_eval do
validates_presence_of :email, if: :email_required?
validates_uniqueness_of :email, allow_blank: true, if: :email_changed?
validates_format_of :email, with: email_regexp, allow_blank: true, if: :email_changed?
validates_presence_of :password, if: :password_required?
validates_confirmation_of :password, if: :password_required?
validates_length_of :password, within: password_length, allow_blank: true
end
end
|