diff --git a/app/lib/pundit/nil_policy_error.rb b/app/lib/pundit/nil_policy_error.rb new file mode 100644 index 00000000..d4e7e23f --- /dev/null +++ b/app/lib/pundit/nil_policy_error.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +# La excepción para capturar un recurso no encontrado y mostrar un 404 +module Pundit + class NilPolicyError < RuntimeError; end +end diff --git a/app/policies/nil_class_policy.rb b/app/policies/nil_class_policy.rb index ef848955..7d890c7f 100644 --- a/app/policies/nil_class_policy.rb +++ b/app/policies/nil_class_policy.rb @@ -6,8 +6,6 @@ # @see app/controllers/application_controller.rb # @see app/controllers/posts_controller.rb # @see app/controllers/site_controller.rb -class Pundit::NilPolicyError < RuntimeError; end - class NilClassPolicy def initialize(_, _) raise Pundit::NilPolicyError