trilogy-libraries / activerecord-trilogy-adapter

Active Record adapter for the Trilogy database client for Rails v6.0 - v7.0.
https://github.com/trilogy-libraries/trilogy
MIT License
167 stars 16 forks source link

AR 7.1 update affected test for AbstractAdapter#transform_query #27

Closed lorint closed 1 year ago

lorint commented 1 year ago

A recently-merged update to ActiveRecord now causes the adapter context to be brought in when query transformers are being called. Here is the relevant method in AbstractAdapter, note the addition of the parameter self:

def transform_query(sql)
  ActiveRecord.query_transformers.each do |transformer|
    sql = transformer.call(sql, self)
  end
  sql
end

It's part of this commit: https://github.com/rails/rails/commit/d3b41750fb308662a9871139e6cd39849b0c03d8

composerinteralia commented 1 year ago

Thank you!