Class: ApplicationPolicy
- Inherits:
-
Object
show all
- Defined in:
- app/policies/application_policy.rb
Overview
Default generated policies
Defined Under Namespace
Classes: Scope
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
14
15
16
17
|
# File 'app/policies/application_policy.rb', line 14
def initialize(user, record)
@user = user
@record = record
end
|
Instance Attribute Details
#record ⇒ Object
`ApplicationRecord` to which try to access
8
9
10
|
# File 'app/policies/application_policy.rb', line 8
def record
@record
end
|
#user ⇒ Object
Who try to access record.
6
7
8
|
# File 'app/policies/application_policy.rb', line 6
def user
@user
end
|
Instance Method Details
#create? ⇒ Boolean
27
28
29
|
# File 'app/policies/application_policy.rb', line 27
def create?
false
end
|
#destroy? ⇒ Boolean
43
44
45
|
# File 'app/policies/application_policy.rb', line 43
def destroy?
false
end
|
#edit? ⇒ Boolean
39
40
41
|
# File 'app/policies/application_policy.rb', line 39
def edit?
update?
end
|
#index? ⇒ Boolean
19
20
21
|
# File 'app/policies/application_policy.rb', line 19
def index?
false
end
|
#new? ⇒ Boolean
31
32
33
|
# File 'app/policies/application_policy.rb', line 31
def new?
create?
end
|
#show? ⇒ Boolean
23
24
25
|
# File 'app/policies/application_policy.rb', line 23
def show?
false
end
|
#update? ⇒ Boolean
35
36
37
|
# File 'app/policies/application_policy.rb', line 35
def update?
false
end
|