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
1 changed files with 3 additions and 3 deletions

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)