Merge pull request #49029 from technicalpickles/abstractcontroller_base-action_methods-performance
Improve performance of AbstractController::Base#action_methods
This commit is contained in:
commit
4df85d7089
@ -91,14 +91,11 @@ def internal_methods
|
||||
def action_methods
|
||||
@action_methods ||= begin
|
||||
# All public instance methods of this class, including ancestors
|
||||
methods = (public_instance_methods(true) -
|
||||
# Except for public instance methods of Base and its ancestors
|
||||
internal_methods +
|
||||
# Be sure to include shadowed public instance methods of this class
|
||||
public_instance_methods(false))
|
||||
|
||||
# except for public instance methods of Base and its ancestors.
|
||||
methods = public_instance_methods(true) - internal_methods
|
||||
# Be sure to include shadowed public instance methods of this class.
|
||||
methods.concat(public_instance_methods(false))
|
||||
methods.map!(&:to_s)
|
||||
|
||||
methods.to_set
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user