Module: Authlogic::Session::Klass::InstanceMethods

Defined in:
lib/authlogic/session/klass.rb

Instance Method Summary collapse

Instance Method Details

#initialize(*args) ⇒ Object

Creating an alias method for the “record” method based on the klass name, so that we can do:

session.user

instead of:

session.record

59
60
61
62
63
64
65
# File 'lib/authlogic/session/klass.rb', line 59

def initialize(*args)
  if !self.class.configured_klass_methods
    self.class.send(:alias_method, klass_name.demodulize.underscore.to_sym, :record)
    self.class.configured_klass_methods = true
  end
  super
end