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

No need to stringify event names (= method names) that always are Symbols

This commit is contained in:
Akira Matsuda 2019-08-30 03:04:52 +09:00
parent 520111096f
commit ffd74f58b0

View file

@ -81,7 +81,7 @@ module ActiveSupport
attr_reader :subscriber, :notifier, :namespace
def add_event_subscriber(event) # :doc:
return if invalid_event?(event.to_s)
return if invalid_event?(event)
pattern = prepare_pattern(event)
@ -92,7 +92,7 @@ module ActiveSupport
end
def remove_event_subscriber(event) # :doc:
return if invalid_event?(event.to_s)
return if invalid_event?(event)
pattern = prepare_pattern(event)
@ -107,7 +107,7 @@ module ActiveSupport
end
def invalid_event?(event)
%w{ start finish }.include?(event.to_s)
%i{ start finish }.include?(event.to_sym)
end
def prepare_pattern(event)