Module: Reflex::Authlogic::Account
- Defined in:
- lib/reflex/authlogic/account.rb
Defined Under Namespace
Modules: ClassMethods, InstanceMethods
Class Method Summary collapse
Class Method Details
.included(base) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/reflex/authlogic/account.rb', line 4 def self.included(base) base.send(:extend, ClassMethods) base.send(:include, InstanceMethods) base.send(:has_many, :reflex_connections, :as => :authorizable, :autosave => true, :class_name => 'Reflex::Authlogic::Connection') # Overwrite authlogic validation options so they are skipped when saving a react account: [:validates_uniqueness_of_login_field_options, :validates_length_of_login_field_options, :validates_format_of_login_field_options, :validates_uniqueness_of_email_field_options, :validates_length_of_email_field_options, :validates_format_of_email_field_options, :validates_length_of_password_field_options, :validates_confirmation_of_password_field_options, :validates_length_of_password_confirmation_field_options].each do || = base.send() base.cattr_accessor "original_#{}" base.send("original_#{}=", .dup) = .merge(:if => nil, :unless => :saving_for_react?) base.send("#{}=", ) end end |