Skip to content

Commit

Permalink
add persisted? for rails 3, thanks to nzadrozny
Browse files Browse the repository at this point in the history
  • Loading branch information
binarylogic committed Sep 5, 2010
1 parent 5661867 commit 66ed795
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/authlogic/session/foundation.rb
Expand Up @@ -53,6 +53,10 @@ def inspect
"#<#{self.class.name}: #{credentials.blank? ? "no credentials provided" : credentials.inspect}>"
end

def persisted?
!(new_record? || destroyed?)
end

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

0 comments on commit 66ed795

Please sign in to comment.