Revision d9d745e5
Added by Ohad Levy over 7 years ago
app/models/notification_blueprint.rb | ||
---|---|---|
validates :expires_in, :numericality => {:greater_than => 0}
|
||
before_validation :set_default_expiry
|
||
|
||
def mass_update_expiry
|
||
notifications.update_all(expired_at: expired_at)
|
||
end
|
||
|
||
def expired_at
|
||
Time.now.utc + expires_in
|
||
end
|
||
|
||
private
|
||
|
||
def set_default_expiry
|
Also available in: Unified diff
fixes #18676 - don't ignore notification expiry
This also adds the ability to mass refresh expiry dates.