Skip to content
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

Merged

Conversation

zmariscal
Copy link
Contributor

@zmariscal zmariscal commented Feb 3, 2024

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.

@zmariscal zmariscal mentioned this pull request Feb 3, 2024
@zmariscal zmariscal force-pushed the feature--add-trilogy-adapter-github-workflow branch from 5ecf990 to d0611bf Compare February 4, 2024 06:41
@@ -81,6 +95,7 @@ jobs:
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
rubygems: latest
Copy link
Contributor Author

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' }}
Copy link
Contributor Author

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.

Comment on lines +29 to +32
gem "trilogy" if version >= 6.0
if version >= 6.0 && version <= 7.0
gem "activerecord-trilogy-adapter"
end
Copy link
Contributor Author

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.

Comment on lines +44 to +48
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.0.0")
gem "factory_bot"
else
gem "factory_bot", "~> 5", "< 6.4.5"
end
Copy link
Contributor Author

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.

@zmariscal zmariscal mentioned this pull request Feb 5, 2024
@jkowens
Copy link
Collaborator

jkowens commented Feb 5, 2024

Thanks @zmariscal! This is awesome 🙌

@jkowens jkowens merged commit cfab0ae into zdennis:master Feb 5, 2024
36 checks passed
@zmariscal zmariscal deleted the feature--add-trilogy-adapter-github-workflow branch February 5, 2024 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants