mirror of https://github.com/rails/rails
No need to stringify event names (= method names) that always are Symbols
This commit is contained in:
parent
520111096f
commit
ffd74f58b0
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue