diff options
Diffstat (limited to 'app/models/account_domain_permission.rb')
-rw-r--r-- | app/models/account_domain_permission.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/account_domain_permission.rb b/app/models/account_domain_permission.rb index 8048c2d4a..e91a4b8cf 100644 --- a/app/models/account_domain_permission.rb +++ b/app/models/account_domain_permission.rb @@ -11,12 +11,15 @@ class AccountDomainPermission < ApplicationRecord include Paginable + include Cacheable belongs_to :account, inverse_of: :domain_permissions enum visibility: [:public, :unlisted, :private, :direct, :limited], _suffix: :visibility default_scope { order(domain: :desc) } + cache_associated :account + class << self def create_by_domains(permissions_list) Array(permissions_list).map(&method(:normalize)).map do |permissions| |