Browse files

add persisted? for rails 3, thanks to nzadrozny

  • Loading branch information...
1 parent 5661867 commit 66ed79515919fe13016911b10ebe734cf8718dc7 @binarylogic binarylogic committed Sep 5, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/authlogic/session/foundation.rb
View
4 lib/authlogic/session/foundation.rb
@@ -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

0 comments on commit 66ed795

Please sign in to comment.