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
fix module access?
  • Loading branch information
octokatherine committed Oct 26, 2023
commit f6303714c6e5baaff66cdba0f4c2f32a1cfc226d
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 Gem::Version.new(::Rails.version) < Gem::Version.new('7.2')
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what's best practice, but alternative would be to check if synchronize method is present to make it more like feature detection instead of version detection.

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 like that idea, I'll update it

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

Expand Down