Module: AuthlogicRpx::Session::Methods

Defined in:
lib/authlogic_rpx/session.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



61
62
63
64
65
66
67
# File 'lib/authlogic_rpx/session.rb', line 61

def self.included(klass)
	klass.class_eval do
		attr_accessor :new_registration
		after_persisting :add_rpx_identifier, :if => :adding_rpx_identifier?
		validate :validate_by_rpx, :if => :authenticating_with_rpx?
	end
end

Instance Method Details

#new_registration?Boolean

Determines if the authenticated user is also a new registration. For use in the session controller to help direct the most appropriate action to follow.

Returns:

  • (Boolean)


72
73
74
# File 'lib/authlogic_rpx/session.rb', line 72

def new_registration?
	new_registration || !new_registration.nil?
end

#registration_complete?Boolean

Determines if the authenticated user has a complete registration (no validation errors) For use in the session controller to help direct the most appropriate action to follow.

Returns:

  • (Boolean)


79
80
81
# File 'lib/authlogic_rpx/session.rb', line 79

def registration_complete?
	attempted_record && attempted_record.valid?
end

#to_keyObject

TODO: rails 3 authlogic monkeypatch. Not sure if this code is quite right yet



84
85
86
# File 'lib/authlogic_rpx/session.rb', line 84

def to_key
  new_record? ? nil : [ self.send(self.class.primary_key) ]
end