Class: ShelfPolicy

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

Defined Under Namespace

Classes: Scope

Instance Attribute Summary

Attributes inherited from ApplicationPolicy

#record, #user

Instance Method Summary collapse

Methods inherited from ApplicationPolicy

#initialize, #scope

Constructor Details

This class inherits a constructor from ApplicationPolicy

Instance Method Details

#create?Boolean

Returns:

  • (Boolean)

5
# File 'app/policies/shelf_policy.rb', line 5

def create? ; belongs_to_current_user? ; end

#destroy?Boolean

Returns:

  • (Boolean)

9
# File 'app/policies/shelf_policy.rb', line 9

def destroy?; belongs_to_current_user? and not record.built_in ; end

#edit?Boolean

Returns:

  • (Boolean)

8
# File 'app/policies/shelf_policy.rb', line 8

def edit?   ; belongs_to_current_user? ; end

#index?Boolean

Returns:

  • (Boolean)

3
# File 'app/policies/shelf_policy.rb', line 3

def index?  ; belongs_to_current_user? ; end

#new?Boolean

Returns:

  • (Boolean)

6
# File 'app/policies/shelf_policy.rb', line 6

def new?    ; belongs_to_current_user? ; end

#show?Boolean

Returns:

  • (Boolean)

4
# File 'app/policies/shelf_policy.rb', line 4

def show?   ; belongs_to_current_user? ; end

#update?Boolean

Returns:

  • (Boolean)

7
# File 'app/policies/shelf_policy.rb', line 7

def update? ; belongs_to_current_user? ; end