Class: CafeCar::ApplicationPolicy
- Inherits:
-
Object
- Object
- CafeCar::ApplicationPolicy
show all
- Includes:
- Policy
- Defined in:
- app/policies/cafe_car/application_policy.rb
Defined Under Namespace
Classes: Attributes, Scope
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from Policy
#association_for_attribute, #displayable_associations, #displayable_attribute?, #displayable_attributes, #editable_attributes, #filtered_attribute?, #info, #listable_attributes, #logo_attribute, #model, #permitted_association?, #permitted_attribute?, #permitted_attribute_keys, #permitted_fields, #policy, #title_attribute
Constructor Details
Returns a new instance of ApplicationPolicy.
8
9
10
11
|
# File 'app/policies/cafe_car/application_policy.rb', line 8
def initialize(user, object)
@user = user
@object = object
end
|
Instance Attribute Details
#object ⇒ Object
Returns the value of attribute object.
6
7
8
|
# File 'app/policies/cafe_car/application_policy.rb', line 6
def object
@object
end
|
#user ⇒ Object
Returns the value of attribute user.
6
7
8
|
# File 'app/policies/cafe_car/application_policy.rb', line 6
def user
@user
end
|
Instance Method Details
#attributes ⇒ Object
21
22
23
|
# File 'app/policies/cafe_car/application_policy.rb', line 21
def attributes
@attributes ||= Attributes.new(@user, @object, permitted_attributes)
end
|
#create? ⇒ Boolean
15
|
# File 'app/policies/cafe_car/application_policy.rb', line 15
def create? = false
|
#destroy? ⇒ Boolean
19
|
# File 'app/policies/cafe_car/application_policy.rb', line 19
def destroy? = false
|
#edit? ⇒ Boolean
18
|
# File 'app/policies/cafe_car/application_policy.rb', line 18
def edit? = update?
|
#index? ⇒ Boolean
13
|
# File 'app/policies/cafe_car/application_policy.rb', line 13
def index? = false
|
#new? ⇒ Boolean
16
|
# File 'app/policies/cafe_car/application_policy.rb', line 16
def new? = create?
|
#show? ⇒ Boolean
14
|
# File 'app/policies/cafe_car/application_policy.rb', line 14
def show? = false
|
#update? ⇒ Boolean
17
|
# File 'app/policies/cafe_car/application_policy.rb', line 17
def update? = false
|