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

Add a constraint to prevent using this gem with Rails 7.1 #68

Open mnawalali opened 7 months ago

mnawalali commented 7 months ago

I am using Rails 7.1.1 and when I start my server(rails s) I get the following error unknown keyword: :uses_transaction (ArgumentError)

composerinteralia commented 7 months ago

Do you have a backtrace, or a way we can reproduce this? This doesn't strike me as a Trilogy bug, but tough to help further without more information.

zhuravel commented 7 months ago

I experienced the same issue when used gem "activerecord-trilogy-adapter" in Rails 7.1 app (which does not need it and comes with built-in support for Trilogy).

composerinteralia commented 7 months ago

Ah, we should probably add a < 7.1 constraint on activerecord-trilogy-adapter.

matthewd commented 7 months ago

Unfortunately that'll just send Bundler to find the latest version that had the more open-ended dependency.

Best might be to explicitly check the Rails version and no-op in the Railtie?

composerinteralia commented 7 months ago

That's a good point. Yeah, either no-op or raise/deprecate with a message about removing the gem.

ravangen commented 2 months ago

Perhaps try using trilogy gem instead of activerecord-trilogy-adapter?

Rails v7.1+ includes Trilogy support by default making this gem unnecessary due as part of https://github.com/rails/rails/pull/47880.

I experienced the same issue when using this gem, and did not have the error once I switched over.