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