znamenica/dneslov

View on GitHub
app/policies/name_policy.rb

Summary

Maintainability
A
0 mins
Test Coverage
F
0%
class NamePolicy < ApplicationPolicy
   def all?
      !@user.nil?
   end

   def index?
      !@user.nil?
   end

   def show?
      scope.where(:id => record.id).exists? and !@user.nil?
   end

   def create?
      !@user.nil?
   end

   def update?
      !@user.nil?
   end

   def destroy?
      !@user.nil?
   end
end