This repository has been archived on 2024-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
2018-02-21 17:21:32 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class BackupPolicy < ApplicationPolicy
|
2023-10-03 05:48:57 -04:00
|
|
|
MIN_AGE = 6.days
|
2018-02-21 17:21:32 -05:00
|
|
|
|
|
|
|
def create?
|
|
|
|
user_signed_in? && current_user.backups.where('created_at >= ?', MIN_AGE.ago).count.zero?
|
|
|
|
end
|
|
|
|
end
|