|
|
@ -28,6 +28,8 @@ class CustomFilter < ApplicationRecord
|
|
|
|
account
|
|
|
|
account
|
|
|
|
).freeze
|
|
|
|
).freeze
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
EXPIRATION_DURATIONS = [30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week].freeze
|
|
|
|
|
|
|
|
|
|
|
|
include Expireable
|
|
|
|
include Expireable
|
|
|
|
include Redisable
|
|
|
|
include Redisable
|
|
|
|
|
|
|
|
|
|
|
@ -52,7 +54,7 @@ class CustomFilter < ApplicationRecord
|
|
|
|
return @expires_in if defined?(@expires_in)
|
|
|
|
return @expires_in if defined?(@expires_in)
|
|
|
|
return nil if expires_at.nil?
|
|
|
|
return nil if expires_at.nil?
|
|
|
|
|
|
|
|
|
|
|
|
[30.minutes, 1.hour, 6.hours, 12.hours, 1.day, 1.week].find { |expires_in| expires_in.from_now >= expires_at }
|
|
|
|
EXPIRATION_DURATIONS.find { |expires_in| expires_in.from_now >= expires_at }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
def irreversible=(value)
|
|
|
|
def irreversible=(value)
|
|
|
|