rails-sqlserver / activerecord-sqlserver-adapter

SQL Server Adapter For Rails
MIT License
968 stars 558 forks source link

Apply monkey patches for SQL Server connections only (#933) #1054

Closed djezzzl closed 1 year ago

djezzzl commented 1 year ago

This is a cherry-picked fix that I'm kindly asking you to release for the 6.0+ version.

The original message

Recent versions of Rails support multiple database connections within the same app. It is possible for these connections to use different adapters. For example, one adapter may use SQL Server, and another uses PostgreSQL.

This gem applies some monkey patches to ActiveRecord for SQL Server compatibility. These patches could break other adapters, though, in a multiple-database scenario.

This commit modifies the patches so that they are applied only if the connection is SQL Server. If not, the original ActiveRecord implementation (super) is used instead.

Fixes #929

djezzzl commented 1 year ago

Hi @aidanharan, @metaskills, @annaswims, @wbond, @wpolicarpo 👋

Thank you for the fantastic gem!

Could you please release this fix to the 6.0+ version, too?

aidanharan commented 1 year ago

@djezzzl I just released v6.0.3 of the gem to Rubygems with this fix.

djezzzl commented 1 year ago

Thank you very much, @aidanharan!

Have a great week!