Module | Cms::Authentication::Model |
In: |
lib/cms/authentication/model.rb
|
# File lib/cms/authentication/model.rb, line 4 4: def self.included(model_class) 5: model_class.extend ClassMethods 6: model_class.class_eval do 7: include InstanceMethods 8: 9: # Virtual attribute for the unencrypted password 10: attr_accessor :password 11: validates_presence_of :password, :if => :password_required? 12: validates_presence_of :password_confirmation, :if => :password_required? 13: validates_confirmation_of :password, :if => :password_required? 14: #validates_length_of :password, :within => 6..40, :if => :password_required? 15: before_save :encrypt_password 16: end 17: end