lib/tokens/token.rb in tokens-0.1.0 vs lib/tokens/token.rb in tokens-0.2.0.beta.1
- old
+ new
@@ -1,19 +1,19 @@
class Token < ActiveRecord::Base
belongs_to :tokenizable, :polymorphic => true
-
+
def hash
token
end
-
+
def to_s
hash
end
-
+
def expired?
expires_at && expires_at < Time.now
end
-
- def self.delete_expired
- delete_all ["expires_at < ? AND expires_at IS NOT NULL", Time.now]
+
+ def self.clean
+ delete_all ["expires_at < ? AND expires_at IS NOT NULL", Time.now]
end
-end
\ No newline at end of file
+end