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

Upgrade to ruby 3 #71

Merged
merged 3 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ jobs:
matrix:
gemfile:
- Gemfile
- Gemfile.5.2
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing CI job for unsupported rail versions.

- Gemfile.6.0
- Gemfile.6.1
env:
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
Expand All @@ -24,7 +22,7 @@ jobs:
- name: Set up Ruby ${{ matrix.ruby-version }}
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.1
- name: Install dependencies
run: bundle install
- name: Run tests
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gem-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Ruby 2.7
- name: Set up Ruby 3.1
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
ruby-version: 3.1

- name: Publish to RubyGems
env:
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
source 'https://rubygems.org'

gem "activerecord", ">=7"
gem "sqlite3", "~> 1.4"
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 a constraint on ActiveRecord connection https://github.com/rails/rails/blob/v7.1.3.4/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb#L14
Without it, we will get higher version of sqlite3 which break the connection.
Latest beta version already fixed the problem, we just need to wait until the stable version to upgrade.

# Specify your gem's dependencies in jit_preloader.gemspec
gemspec
6 changes: 0 additions & 6 deletions Gemfile.5.2

This file was deleted.

72 changes: 0 additions & 72 deletions Gemfile.5.2.lock

This file was deleted.

4 changes: 1 addition & 3 deletions lib/jit_preloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
if Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("7.0.0")
require 'jit_preloader/active_record/associations/preloader/ar7_association'
require 'jit_preloader/active_record/associations/preloader/ar7_branch'
elsif Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("6.0.0")
elsif Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("6.1.0")
require 'jit_preloader/active_record/associations/preloader/ar6_association'
elsif Gem::Version.new(ActiveRecord::VERSION::STRING) >= Gem::Version.new("5.2.2")
require 'jit_preloader/active_record/associations/preloader/ar5_association'
else
require 'jit_preloader/active_record/associations/preloader/collection_association'
require 'jit_preloader/active_record/associations/preloader/singular_association'
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion lib/jit_preloader/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module JitPreloader
VERSION = "2.1.0"
VERSION = "3.0.0"
end