lib/ownership.rb in ownership-0.3.0 vs lib/ownership.rb in ownership-0.4.0
- old
+ new
@@ -24,10 +24,13 @@
include Ownership::ControllerMethods
end
ActiveSupport.on_load(:active_record) do
if ActiveRecord::VERSION::MAJOR >= 7
- ActiveRecord::QueryLogs.taggings[:owner] ||= -> { Ownership.owner }
+ # taggings is frozen in Active Record 8
+ if !ActiveRecord::QueryLogs.taggings[:owner]
+ ActiveRecord::QueryLogs.taggings = ActiveRecord::QueryLogs.taggings.merge({owner: -> { Ownership.owner }})
+ end
end
require_relative "ownership/marginalia" if defined?(Marginalia)
end