logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

backup_policy.rb (208B)


  1. # frozen_string_literal: true
  2. class BackupPolicy < ApplicationPolicy
  3. MIN_AGE = 1.week
  4. def create?
  5. user_signed_in? && current_user.backups.where('created_at >= ?', MIN_AGE.ago).count.zero?
  6. end
  7. end