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

Commit

Permalink
Merge pull request #115 from erikaxel/fix-after-filter-deprecation
Browse files Browse the repository at this point in the history
Fix rails 5 after_filter deprecation
  • Loading branch information
nathanl authored Dec 20, 2016
2 parents d0079fa + d7ea3b0 commit 537107b
Showing 1 changed file with 9 additions and 3 deletions.
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

0 comments on commit 537107b

Please sign in to comment.