Class: ApplicationPolicy::Scope

Inherits:
Object
  • Object
show all
Defined in:
app/policies/application_policy.rb

Overview

setup Scope, Required by Pundit

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user, scope) ⇒ Scope

Returns a new instance of Scope.



27
28
29
30
# File 'app/policies/application_policy.rb', line 27

def initialize(user, scope)
  @user = user
  @scope = scope
end

Instance Attribute Details

#scopeObject (readonly)

Returns the value of attribute scope.



25
26
27
# File 'app/policies/application_policy.rb', line 25

def scope
  @scope
end

#userObject (readonly)

Returns the value of attribute user.



25
26
27
# File 'app/policies/application_policy.rb', line 25

def user
  @user
end

Instance Method Details

#resolveObject



32
33
34
# File 'app/policies/application_policy.rb', line 32

def resolve
  scope
end