1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/models/account_role.rb

18 lines
351 B
Ruby

# frozen_string_literal: true
class AccountRole < ApplicationRecord
belongs_to :account
belongs_to :role
scope :active, -> { where(deleted_at: nil) }
validate :deleted_at_is_not_in_future
private
def deleted_at_is_not_in_future
return if deleted_at.nil?
errors.add :deleted_at unless deleted_at <= Time.zone.now + 10
end
end