Skip to content
This repository has been archived by the owner on Nov 19, 2019. It is now read-only.

Fix rails 5 after_filter deprecation #115

Merged
merged 1 commit into from
Dec 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/authority/controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,15 @@ def authority_action(action_map)

# Convenience wrapper for instance method
def ensure_authorization_performed(options = {})
after_filter(options.slice(:only, :except)) do |controller_instance|
controller_instance.ensure_authorization_performed(options)
end
if respond_to? :after_action
after_action(options.slice(:only, :except)) do |controller_instance|
controller_instance.ensure_authorization_performed(options)
end
else
after_filter(options.slice(:only, :except)) do |controller_instance|
controller_instance.ensure_authorization_performed(options)
end
end
end

# The controller action to authority action map used for determining
Expand Down