-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Add trilogy adapter support #825
[Feature] Add trilogy adapter support #825
Conversation
5ecf990
to
d0611bf
Compare
@@ -81,6 +95,7 @@ jobs: | |||
with: | |||
ruby-version: ${{ matrix.ruby }} | |||
bundler-cache: true | |||
rubygems: latest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added this because this error was raised. This should ensure this type of error doesn't happen again.
@@ -110,6 +125,9 @@ jobs: | |||
run: | | |||
bundle exec rake test:spatialite | |||
bundle exec rake test:sqlite3 | |||
- name: Run trilogy tests | |||
if: ${{ matrix.env.AR_VERSION >= '7.0' && matrix.ruby != 'jruby' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not entirely sure where the trilogy gem stands with jruby, but I couldn't figure out a way to get it to successfully run.
gem "trilogy" if version >= 6.0 | ||
if version >= 6.0 && version <= 7.0 | ||
gem "activerecord-trilogy-adapter" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Regarding the integration of Trilogy, theoretically, it should seamlessly function with any framework equipped with the active record-trilogy-adapter
. Notably, Rails 7.1 conveniently incorporates this adapter by default. You can explore the prerequisites for this gem here. However, a noteworthy discovery I made is the importance of the composite_primary_keys
version. Compatibility issues arise with versions preceding AR 7 due to limitations intertwined with the ActiveRecord version.
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.0.0") | ||
gem "factory_bot" | ||
else | ||
gem "factory_bot", "~> 5", "< 6.4.5" | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is required due to the newest version of factory_bot requiring Ruby 3.0.
Thanks @zmariscal! This is awesome 🙌 |
Purpose
Bring support for the Trilogy adapterto this project. I work on a Rails project and would like to switch to this new adapter. When running our CI I discovered this gem didn’t have support. Which then pointed to a child dependency that needed that support. I added that here.