Skip to content

Commit

Permalink
check for synchronize method instead of Rails version
Browse files Browse the repository at this point in the history
  • Loading branch information
octokatherine committed Oct 29, 2023
1 parent f630371 commit bb699be
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def self.subscribe(

subscriber_object = ::ActiveSupport::Notifications.subscribe(pattern, subscriber)

if Gem::Version.new(::Rails.version) < Gem::Version.new('7.2')
if ::ActiveSupport::Notifications.notifier.respond_to?(:synchronize)
::ActiveSupport::Notifications.notifier.synchronize do
subscribers = ::ActiveSupport::Notifications.notifier.instance_variable_get(:@string_subscribers)[pattern]

Expand Down

0 comments on commit bb699be

Please sign in to comment.