mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 07:26:22 +02:00
17 lines
290 B
Ruby
17 lines
290 B
Ruby
module Billing::Price::Expirable
|
|
extend ActiveSupport::Concern
|
|
|
|
class_methods do
|
|
def expired
|
|
where("#{attribute_alias(:expire_time)} < ?", Time.zone.now)
|
|
end
|
|
end
|
|
|
|
def expire
|
|
self[:valid_to] = Time.zone.now - 1
|
|
end
|
|
|
|
def expired?
|
|
expire_time.past?
|
|
end
|
|
end
|