Skip to content

Commit

Permalink
Merge pull request #440 from evsasse/7-x-support-rails-8
Browse files Browse the repository at this point in the history
Support ActiveRecord/Rails 8.0, on Sequent 7.x
  • Loading branch information
erikrozendaal authored Jan 3, 2025
2 parents f4bfe1a + e93b507 commit a0c838e
Show file tree
Hide file tree
Showing 5 changed files with 156 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/rspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
strategy:
matrix:
include:
- ruby-version: 3.4
gemfile: 'ar_8_0'
- ruby-version: 3.3
gemfile: 'ar_7_2'
- ruby-version: 3.3
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ Ensure the version in `lib/version.rb` is the new version. If not change it and

Then run `rake release`. A git tag will be created and pushed, and the new version of the gem will be pushed to rubygems.

Increase version to new working version, update the sequent version for all the `gemfiles`:
Increase version to new working version, update the sequent version for all the `gemfiles`:

```
BUNDLE_GEMFILE=gemfiles/ar_6_0.gemfile bundle update sequent --conservative
BUNDLE_GEMFILE=gemfiles/ar_6_1.gemfile bundle update sequent --conservative
BUNDLE_GEMFILE=gemfiles/ar_7_0.gemfile bundle update sequent --conservative
BUNDLE_GEMFILE=gemfiles/ar_7_1.gemfile bundle update sequent --conservative
BUNDLE_GEMFILE=gemfiles/ar_7_2.gemfile bundle update sequent --conservative
BUNDLE_GEMFILE=gemfiles/ar_8_0.gemfile bundle update sequent --conservative
```

## Running the specs
Expand Down
10 changes: 10 additions & 0 deletions gemfiles/ar_8_0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

source 'https://rubygems.org'

active_star_version = '= 8.0.1'

gem 'activemodel', active_star_version
gem 'activerecord', active_star_version

gemspec path: '../'
141 changes: 141 additions & 0 deletions gemfiles/ar_8_0.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
PATH
remote: ..
specs:
sequent (7.2.1)
activemodel (>= 6.0)
activerecord (>= 6.0)
bcrypt (~> 3.1)
csv (~> 3.3)
i18n
logger (~> 1.6)
oj (~> 3.3)
parallel (~> 1.20)
parser (>= 2.6.5, < 3.4)
pg (~> 1.2)
postgresql_cursor (~> 0.6)
thread_safe (~> 0.3.6)
tzinfo (>= 1.1)

GEM
remote: https://rubygems.org/
specs:
activemodel (8.0.1)
activesupport (= 8.0.1)
activerecord (8.0.1)
activemodel (= 8.0.1)
activesupport (= 8.0.1)
timeout (>= 0.4.0)
activesupport (8.0.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.2)
base64 (0.2.0)
bcrypt (3.1.20)
benchmark (0.4.0)
bigdecimal (3.1.9)
coderay (1.1.3)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
csv (3.3.2)
diff-lcs (1.5.1)
docile (1.4.1)
drb (2.2.1)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.9.1)
language_server-protocol (3.17.0.3)
logger (1.6.4)
method_source (1.1.0)
minitest (5.25.4)
oj (3.16.9)
bigdecimal (>= 3.0)
ostruct (>= 0.2)
ostruct (0.6.1)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
pg (1.5.9)
postgresql_cursor (0.6.9)
activerecord (>= 6.0)
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.10.0)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-collection_matchers (1.2.1)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
rubocop (1.69.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
thread_safe (0.3.6)
timecop (0.9.10)
timeout (0.4.3)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.1.3)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.2)

PLATFORMS
arm64-darwin-23
ruby

DEPENDENCIES
activemodel (= 8.0.1)
activerecord (= 8.0.1)
pry (~> 0.13)
rake (~> 13)
rspec (~> 3.10)
rspec-collection_matchers (~> 1.2)
rspec-mocks (~> 3.10)
rubocop (~> 1.56, >= 1.56.3)
sequent!
simplecov (~> 0.21)
timecop (~> 0.9)

BUNDLED WITH
2.5.3
2 changes: 1 addition & 1 deletion lib/sequent/support/database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def self.establish_connection(db_config, db_config_overrides = {})
db_config = db_config.deep_merge(
Sequent.configuration.primary_database_key => db_config_overrides,
).stringify_keys
if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR < 1
if ActiveRecord::VERSION::MAJOR == 7 && ActiveRecord::VERSION::MINOR < 1
ActiveRecord.legacy_connection_handling = false
end
ActiveRecord::Base.configurations = db_config.stringify_keys
Expand Down

0 comments on commit a0c838e

Please sign in to comment.