Sha256: 864d2f90360dfb7c1169b7380b64332a89d4eaa47bffb127a4fb361c9944dcc8
Contents?: true
Size: 674 Bytes
Versions: 8
Compression:
Stored size: 674 Bytes
Contents
class FormUser < User attr_accessor :current_password validates_presence_of :email, if: :email_required? validates_uniqueness_of :email, allow_blank: true, if: :email_changed? validates_format_of :email, with: Devise.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: Devise.password_length, allow_blank: true def password_required? return false if email.blank? !persisted? || !password.nil? || !password_confirmation.nil? end def email_required? true end end
Version data entries
8 entries across 8 versions & 1 rubygems