Class: SbPostPolicy

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

Instance Attribute Summary

Attributes inherited from ApplicationPolicy

#record, #user

Instance Method Summary collapse

Methods inherited from ApplicationPolicy

#create?, #destroy_all?, #index?, #initialize, #new?, #scope, #show?

Constructor Details

This class inherits a constructor from ApplicationPolicy

Instance Method Details

#destroy?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'app/policies/sb_post_policy.rb', line 7

def destroy?
  update?
end

#edit?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'app/policies/sb_post_policy.rb', line 3

def edit?
  update?
end

#update?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'app/policies/sb_post_policy.rb', line 11

def update?
  record.editable_by?(user)
end