Module: Authlogic::Session::ActiveRecordTrickery::InstanceMethods
- Defined in:
- lib/authlogic/session/active_record_trickery.rb
Instance Method Summary collapse
- #destroyed? ⇒ Boolean
-
#new_record? ⇒ Boolean
Don’t use this yourself, this is to just trick some of the helpers since this is the method it calls.
- #persisted? ⇒ Boolean
- #to_key ⇒ Object
-
#to_model ⇒ Object
For rails >= 3.0.
Instance Method Details
#destroyed? ⇒ Boolean
47 48 49 |
# File 'lib/authlogic/session/active_record_trickery.rb', line 47 def destroyed? record.nil? end |
#new_record? ⇒ Boolean
Don’t use this yourself, this is to just trick some of the helpers since this is the method it calls.
39 40 41 |
# File 'lib/authlogic/session/active_record_trickery.rb', line 39 def new_record? new_session? end |
#persisted? ⇒ Boolean
43 44 45 |
# File 'lib/authlogic/session/active_record_trickery.rb', line 43 def persisted? !(new_record? || destroyed?) end |
#to_key ⇒ Object
51 52 53 |
# File 'lib/authlogic/session/active_record_trickery.rb', line 51 def to_key new_record? ? nil : record.to_key end |
#to_model ⇒ Object
For rails >= 3.0
56 57 58 |
# File 'lib/authlogic/session/active_record_trickery.rb', line 56 def to_model self end |