Module: InvisionBridge::ActiveRecord

Defined in:
lib/invision_bridge/active_record.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/invision_bridge/active_record.rb', line 3

def self.included(base)
  base.class_eval do
    establish_connection(InvisionBridge.config)

    # IP.Board database design, grumble grumble
    set_table_name "#{InvisionBridge.config['prefix']}members"
    set_primary_key "member_id"

    # Configure Authlogic
    attr_accessible :name, :login, :password, :password_confirmation
    acts_as_authentic do |c|
      c.crypto_provider          = Authlogic::CryptoProviders::InvisionPowerBoard
      c.              = :name
      c.crypted_password_field   = :members_pass_hash
      c.password_salt_field      = :members_pass_salt
      c.validate_password_field  = false
    end
  end
end