Class: ModelPolicy::Scope

Inherits:
ApplicationPolicy::Scope show all
Defined in:
app/policies/model_policy.rb

Instance Method Summary collapse

Methods inherited from ApplicationPolicy::Scope

#initialize

Constructor Details

This class inherits a constructor from ApplicationPolicy::Scope

Instance Method Details

#resolve ⇒ Object



52
53
54
55
56
57
58
# File 'app/policies/model_policy.rb', line 52

def resolve
  if user&.sensitive_content_handling == "hide"
    super.where(sensitive: false)
  else
    super
  end
end