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:
parent
3037022789
commit
2167f95d85
1 changed files with 2 additions and 10 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue