Fix subscription expiration condition (#2715)
* Fix subscription expiration condition * dry and add spec
This commit is contained in:
parent
b9b78549f3
commit
6f75c8451d
3 changed files with 20 additions and 3 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue