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
69 70 71 |
# File 'lib/authlogic/session/active_record_trickery.rb', line 69 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.
61 62 63 |
# File 'lib/authlogic/session/active_record_trickery.rb', line 61 def new_record? new_session? end |
#persisted? ⇒ Boolean
65 66 67 |
# File 'lib/authlogic/session/active_record_trickery.rb', line 65 def persisted? !(new_record? || destroyed?) end |
#to_key ⇒ Object
73 74 75 |
# File 'lib/authlogic/session/active_record_trickery.rb', line 73 def to_key new_record? ? nil : record.to_key end |
#to_model ⇒ Object
For rails >= 3.0
78 79 80 |
# File 'lib/authlogic/session/active_record_trickery.rb', line 78 def to_model self end |