handle pundit errors with http 403

This commit is contained in:
Devin Howard 2016-02-28 13:24:55 +08:00
parent bc7db85c8c
commit cec6d3bfcd

View file

@ -53,5 +53,8 @@ module Metamaps
g.test_framework :rspec
end
config.active_record.raise_in_transactional_callbacks = true
# pundit errors return 403 FORBIDDEN
config.action_dispatch.rescue_responses["Pundit::NotAuthorizedError"] = :forbidden
end
end