Module: Authlogic::ActsAsAuthentic::MagicColumns::Methods

Defined in:
lib/authlogic/acts_as_authentic/magic_columns.rb

Overview

Methods relating to the magic columns

Class Method Summary (collapse)

Class Method Details

+ (Object) included(klass)



15
16
17
18
19
20
# File 'lib/authlogic/acts_as_authentic/magic_columns.rb', line 15

def self.included(klass)
  klass.class_eval do
    validates_numericality_of :login_count, :only_integer => :true, :greater_than_or_equal_to => 0, :allow_nil => true if column_names.include?("login_count")
    validates_numericality_of :failed_login_count, :only_integer => :true, :greater_than_or_equal_to => 0, :allow_nil => true if column_names.include?("failed_login_count")
  end
end