Skip to content

Commit

Permalink
Fix Rails 7.2 compatibility
Browse files Browse the repository at this point in the history
In order to use parts of active_support, active_support itself must be required first.
https://guides.rubyonrails.org/active_support_core_extensions.html#cherry-picking-a-definition

Fixes #1685
  • Loading branch information
Earlopain committed Aug 13, 2024
1 parent f9ece3d commit 0a73f50
Show file tree
Hide file tree
Showing 5 changed files with 200 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,20 @@ jobs:
- "6.1"
- "7.0"
- "7.1"
- "7.2"
- main
exclude:
- ruby: jruby-9.4
rails: "7.1"
- ruby: jruby-9.4
rails: "7.2"
- ruby: jruby-9.4
rails: main
# Rails >= 7.2 requires Ruby 3.1
- ruby: "3.0"
rails: "7.2"
- ruby: "3.0"
rails: "main"

runs-on: 'ubuntu-latest'

Expand Down
8 changes: 8 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ appraise "7.1" do
gem "sqlite3", "~> 1.4", platforms: [:ruby]
end

appraise "7.2" do
gem "activerecord", "~> 7.2.0"
# When version 71 is released, uncomment this and also allow it in the GitHub
# Action build workflow.
# gem "activerecord-jdbcsqlite3-adapter", "~> 71.0", platforms: [:jruby]
gem "sqlite3", platforms: [:ruby]
end

appraise "main" do
gem "activerecord", git: "https://github.com/rails/rails.git", branch: "main"
gem "activerecord-jdbcsqlite3-adapter", "~> 70.0", platforms: [:jruby]
Expand Down
9 changes: 9 additions & 0 deletions gemfiles/7.2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "activerecord-jdbcsqlite3-adapter", platforms: [:jruby]
gem "sqlite3", platforms: [:ruby]
gem "activerecord", "~> 7.2.0"

gemspec name: "factory_bot", path: "../"
174 changes: 174 additions & 0 deletions gemfiles/7.2.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
PATH
remote: ..
specs:
factory_bot (6.4.6)
activesupport (>= 5.0.0)

GEM
remote: https://rubygems.org/
specs:
activemodel (7.2.0)
activesupport (= 7.2.0)
activerecord (7.2.0)
activemodel (= 7.2.0)
activesupport (= 7.2.0)
timeout (>= 0.4.0)
activesupport (7.2.0)
base64
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)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
aruba (2.2.0)
bundler (>= 1.17, < 3.0)
contracts (>= 0.16.0, < 0.18.0)
cucumber (>= 8.0, < 10.0)
rspec-expectations (~> 3.4)
thor (~> 1.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.8)
builder (3.3.0)
concurrent-ruby (1.3.4)
connection_pool (2.4.1)
contracts (0.17)
cucumber (9.2.0)
builder (~> 3.2)
cucumber-ci-environment (> 9, < 11)
cucumber-core (> 13, < 14)
cucumber-cucumber-expressions (~> 17.0)
cucumber-gherkin (> 24, < 28)
cucumber-html-formatter (> 20.3, < 22)
cucumber-messages (> 19, < 25)
diff-lcs (~> 1.5)
mini_mime (~> 1.1)
multi_test (~> 1.1)
sys-uname (~> 1.2)
cucumber-ci-environment (10.0.1)
cucumber-core (13.0.3)
cucumber-gherkin (>= 27, < 28)
cucumber-messages (>= 20, < 23)
cucumber-tag-expressions (> 5, < 7)
cucumber-cucumber-expressions (17.1.0)
bigdecimal
cucumber-gherkin (27.0.0)
cucumber-messages (>= 19.1.4, < 23)
cucumber-html-formatter (21.7.0)
cucumber-messages (> 19, < 27)
cucumber-messages (22.0.0)
cucumber-tag-expressions (6.1.0)
diff-lcs (1.5.1)
docile (1.4.1)
drb (2.2.1)
ffi (1.17.0-x86_64-linux-gnu)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
json (2.7.2)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
logger (1.6.0)
mini_mime (1.1.5)
minitest (5.24.1)
multi_test (1.1.0)
parallel (1.26.2)
parser (3.3.4.2)
ast (~> 2.4.1)
racc
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.9.2)
rexml (3.3.5)
strscan
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.0)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-its (1.3.0)
rspec-core (>= 3.0.0)
rspec-expectations (>= 3.0.0)
rspec-mocks (3.13.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.1)
rubocop (1.64.1)
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 (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.32.0)
parser (>= 3.3.1.0)
rubocop-performance (1.21.1)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
securerandom (0.3.1)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
sqlite3 (2.0.3-x86_64-linux-gnu)
standard (1.39.2)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.64.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.4)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.4.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.21.0)
strscan (3.1.0)
sys-uname (1.3.0)
ffi (~> 1.1)
thor (1.3.1)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
yard (0.9.36)

PLATFORMS
x86_64-linux

DEPENDENCIES
activerecord (~> 7.2.0)
activerecord-jdbcsqlite3-adapter
appraisal
aruba
cucumber
factory_bot!
rake
rspec
rspec-its
simplecov
sqlite3
standard
yard

BUNDLED WITH
2.5.16
1 change: 1 addition & 0 deletions lib/factory_bot.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require "set"
require "active_support"
require "active_support/core_ext/module/delegation"
require "active_support/core_ext/module/attribute_accessors"
require "active_support/deprecation"
Expand Down

0 comments on commit 0a73f50

Please sign in to comment.