Skip to content

Commit

Permalink
Restore the more readable before_ and after_filters methods since the…
Browse files Browse the repository at this point in the history
…y aren't called frequently
  • Loading branch information
jeremy committed Jul 14, 2008
1 parent 3037022 commit 2167f95
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions actionpack/lib/action_controller/filters.rb
Expand Up @@ -569,21 +569,13 @@ def filter_chain
# Returns all the before filters for this class and all its ancestors. # Returns all the before filters for this class and all its ancestors.
# This method returns the actual filter that was assigned in the controller to maintain existing functionality. # This method returns the actual filter that was assigned in the controller to maintain existing functionality.
def before_filters #:nodoc: def before_filters #:nodoc:
filters = [] filter_chain.select(&:before?).map(&:method)
filter_chain.each do |filter|
filters << filter.method if filter.before?
end
filters
end end


# Returns all the after filters for this class and all its ancestors. # Returns all the after filters for this class and all its ancestors.
# This method returns the actual filter that was assigned in the controller to maintain existing functionality. # This method returns the actual filter that was assigned in the controller to maintain existing functionality.
def after_filters #:nodoc: def after_filters #:nodoc:
filters = [] filter_chain.select(&:after?).map(&:method)
filter_chain.each do |filter|
filters << filter.method if filter.after?
end
filters
end end
end end


Expand Down

0 comments on commit 2167f95

Please sign in to comment.