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/policies/settings/account_telegram_contact_policy.rb

15 lines
305 B
Ruby

# frozen_string_literal: true
class Settings::AccountTelegramContactPolicy < ApplicationPolicy
def index?
!!context.guest_account
end
class Scope < Scope
def resolve
return scope.none if context.guest_account.nil?
scope.where(account: context.guest_account)
end
end
end