Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
check for synchronize method instead of Rails version
  • Loading branch information
octokatherine committed Oct 29, 2023
commit bb699be8a482726ecd95701745b696c63c173f36
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to leave any comments to our future selves that we can remove this block once everything prior to 7.2 is EoL?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm happy to add a comment!

::ActiveSupport::Notifications.notifier.synchronize do
subscribers = ::ActiveSupport::Notifications.notifier.instance_variable_get(:@string_subscribers)[pattern]

Expand Down