Fix subscription expiration condition (#2715)
* Fix subscription expiration condition * dry and add spec
This commit is contained in:
committed by
Eugen Rochko
parent
b9b78549f3
commit
6f75c8451d
@ -33,6 +33,10 @@ class Subscription < ApplicationRecord
|
||||
(expires_at - Time.now.utc).to_i
|
||||
end
|
||||
|
||||
def expired?
|
||||
Time.now.utc > expires_at
|
||||
end
|
||||
|
||||
before_validation :set_min_expiration
|
||||
|
||||
private
|
||||
|
Reference in New Issue
Block a user