##// END OF EJS Templates
Don't compare timestamps with 0, triggers SQL errors with PostgreSQL (#10840)....
Jean-Philippe Lang -
r15793:82d96258f441
parent child
Show More
@@ -48,7 +48,8 class Token < ActiveRecord::Base
48
48
49 # Return true if token has expired
49 # Return true if token has expired
50 def expired?
50 def expired?
51 return created_on < self.class.invalid_when_created_before(action)
51 validity_time = self.class.invalid_when_created_before(action)
52 validity_time.present? && created_on < validity_time
52 end
53 end
53
54
54 def max_instances
55 def max_instances
@@ -63,9 +64,7 class Token < ActiveRecord::Base
63 validity_time = self.validity_time
64 validity_time = self.validity_time
64 end
65 end
65
66
66 if validity_time.nil?
67 if validity_time
67 0
68 else
69 Time.now - validity_time
68 Time.now - validity_time
70 end
69 end
71 end
70 end
General Comments 0
You need to be logged in to leave comments. Login now