1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Restore the more readable before_ and after_filters methods since they aren't called frequently

This commit is contained in:
Jeremy Kemper 2008-07-09 12:38:59 -07:00
parent 3037022789
commit 2167f95d85

View file

@ -569,21 +569,13 @@ module ActionController #:nodoc:
# 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.
def before_filters #:nodoc:
filters = []
filter_chain.each do |filter|
filters << filter.method if filter.before?
end
filters
filter_chain.select(&:before?).map(&:method)
end
# 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.
def after_filters #:nodoc:
filters = []
filter_chain.each do |filter|
filters << filter.method if filter.after?
end
filters
filter_chain.select(&:after?).map(&:method)
end
end