rails / solid_cache

A database-backed ActiveSupport::Cache::Store
MIT License
890 stars 63 forks source link

Addressing Rails Edge breaking change with insert_all #165

Closed ron-shinall closed 8 months ago

ron-shinall commented 8 months ago

This PR addresses a breaking change with Rails Edge insert_all. Prior to the change, insert_all used the connection of the model argument (model.connection). Now the connection has to be passed in as a separate argument.

I have tested this with Appraisal using rails-7, rails-7-1, and rails-main on Ruby 3.3.0.

Rails commit: https://github.com/rails/rails/commit/1c0982d88a83bc733d7334accdd075b97b5db98c

Fixes https://github.com/rails/solid_cache/issues/164

ron-shinall commented 8 months ago

I've also updated rails_main.gemfile.lock to use the latest Rails main, as it was using a commit that was about 6 weeks old (https://github.com/rails/rails/commit/cb035bde4e4a09789792ba69117f602231c36584).

ron-shinall commented 8 months ago

@djmb thoughts on this?

djmb commented 8 months ago

Thanks for the PR @ron-shinall.

This is needed because of the query cache workarounds (see https://github.com/rails/solid_cache/issues/123) which involved using AR internals (and is exactly why we shouldn't have those workarounds!).