From 677e11c908ed61d7554b3aeedacde98aafe524f2 Mon Sep 17 00:00:00 2001 From: Florian Leinsinger Date: Thu, 18 Dec 2025 14:39:41 +0100 Subject: [PATCH 1/3] Remove support for Ruby < 3.1, Rails < 7 --- .github/workflows/test.yml | 26 ++++--- .ruby-version | 2 +- Gemfile | 2 +- Gemfile.6.1.mysql2.lock | 72 ------------------- Gemfile.6.1.pg.lock | 67 ----------------- Gemfile.7.1.mysql2.lock | 2 +- Gemfile.7.1.pg.lock | 2 +- Gemfile.6.1.mysql2 => Gemfile.7.2.mysql2 | 2 +- Gemfile.7.2.mysql2.lock | 90 +++++++++++++++++++++++ Gemfile.6.1.pg => Gemfile.7.2.pg | 2 +- Gemfile.7.2.pg.lock | 89 +++++++++++++++++++++++ Gemfile.8.0.mysql2 | 16 +++++ Gemfile.8.0.mysql2.lock | 92 ++++++++++++++++++++++++ Gemfile.8.0.pg.lock | 2 +- Gemfile.8.1.mysql2 | 16 +++++ Gemfile.8.1.mysql2.lock | 91 +++++++++++++++++++++++ Gemfile.8.1.pg | 16 +++++ Gemfile.8.1.pg.lock | 91 +++++++++++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- 20 files changed, 522 insertions(+), 162 deletions(-) delete mode 100644 Gemfile.6.1.mysql2.lock delete mode 100644 Gemfile.6.1.pg.lock rename Gemfile.6.1.mysql2 => Gemfile.7.2.mysql2 (89%) create mode 100644 Gemfile.7.2.mysql2.lock rename Gemfile.6.1.pg => Gemfile.7.2.pg (89%) create mode 100644 Gemfile.7.2.pg.lock create mode 100644 Gemfile.8.0.mysql2 create mode 100644 Gemfile.8.0.mysql2.lock create mode 100644 Gemfile.8.1.mysql2 create mode 100644 Gemfile.8.1.mysql2.lock create mode 100644 Gemfile.8.1.pg create mode 100644 Gemfile.8.1.pg.lock diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc42d5c..151ff3d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,14 +30,14 @@ jobs: fail-fast: false matrix: include: - - ruby: 2.7.3 - gemfile: Gemfile.6.1.mysql2 - - ruby: 2.7.3 - gemfile: Gemfile.7.1.mysql2 - - ruby: 3.3.0 - gemfile: Gemfile.6.1.mysql2 - - ruby: 3.3.0 + - ruby: 3.3.6 gemfile: Gemfile.7.1.mysql2 + - ruby: 3.3.6 + gemfile: Gemfile.7.2.mysql2 + - ruby: 3.3.6 + gemfile: Gemfile.8.0.mysql2 + - ruby: 3.4.7 + gemfile: Gemfile.8.1.mysql2 env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} @@ -76,16 +76,14 @@ jobs: fail-fast: false matrix: include: - - ruby: 2.7.3 - gemfile: Gemfile.6.1.pg - - ruby: 2.7.3 - gemfile: Gemfile.7.1.pg - - ruby: 3.3.0 - gemfile: Gemfile.6.1.pg - - ruby: 3.3.0 + - ruby: 3.3.6 gemfile: Gemfile.7.1.pg + - ruby: 3.3.6 + gemfile: Gemfile.7.2.pg - ruby: 3.3.6 gemfile: Gemfile.8.0.pg + - ruby: 3.4.7 + gemfile: Gemfile.8.1.pg env: BUNDLE_GEMFILE: ${{ matrix.gemfile }} diff --git a/.ruby-version b/.ruby-version index 15a2799..2aa5131 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.0 +3.4.7 diff --git a/Gemfile b/Gemfile index 806dbda..9d6ed7d 120000 --- a/Gemfile +++ b/Gemfile @@ -1 +1 @@ -Gemfile.7.1.pg \ No newline at end of file +Gemfile.8.1.pg \ No newline at end of file diff --git a/Gemfile.6.1.mysql2.lock b/Gemfile.6.1.mysql2.lock deleted file mode 100644 index 55b9f8f..0000000 --- a/Gemfile.6.1.mysql2.lock +++ /dev/null @@ -1,72 +0,0 @@ -PATH - remote: . - specs: - assignable_values (1.1.1) - activerecord (>= 2.3) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (6.1.7.10) - activesupport (= 6.1.7.10) - activerecord (6.1.7.10) - activemodel (= 6.1.7.10) - activesupport (= 6.1.7.10) - activesupport (6.1.7.10) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) - concurrent-ruby (1.3.4) - database_cleaner (2.1.0) - database_cleaner-active_record (>= 2, < 3) - database_cleaner-active_record (2.2.0) - activerecord (>= 5.a) - database_cleaner-core (~> 2.0.0) - database_cleaner-core (2.0.1) - diff-lcs (1.6.0) - gemika (0.8.4) - i18n (1.14.7) - concurrent-ruby (~> 1.0) - minitest (5.25.4) - mysql2 (0.5.6) - rake (13.2.1) - rspec (3.13.0) - rspec-core (~> 3.13.0) - rspec-expectations (~> 3.13.0) - rspec-mocks (~> 3.13.0) - rspec-core (3.13.3) - 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) - rspec_candy (0.5.1) - rspec - sneaky-save - sneaky-save (0.1.3) - activerecord (>= 3.2.0) - tzinfo (2.0.6) - concurrent-ruby (~> 1.0) - zeitwerk (2.4.2) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (~> 6.1.3) - assignable_values! - database_cleaner - gemika (~> 0.8.0) - i18n - mysql2 - rake - rspec - rspec_candy - -BUNDLED WITH - 2.2.15 diff --git a/Gemfile.6.1.pg.lock b/Gemfile.6.1.pg.lock deleted file mode 100644 index e74deff..0000000 --- a/Gemfile.6.1.pg.lock +++ /dev/null @@ -1,67 +0,0 @@ -PATH - remote: . - specs: - assignable_values (1.1.1) - activerecord (>= 2.3) - -GEM - remote: https://rubygems.org/ - specs: - activemodel (6.1.3.2) - activesupport (= 6.1.3.2) - activerecord (6.1.3.2) - activemodel (= 6.1.3.2) - activesupport (= 6.1.3.2) - activesupport (6.1.3.2) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 1.6, < 2) - minitest (>= 5.1) - tzinfo (~> 2.0) - zeitwerk (~> 2.3) - concurrent-ruby (1.1.5) - database_cleaner (1.7.0) - diff-lcs (1.3) - gemika (0.8.0) - i18n (1.6.0) - concurrent-ruby (~> 1.0) - minitest (5.14.4) - pg (1.3.5) - rake (12.3.2) - rspec (3.8.0) - rspec-core (~> 3.8.0) - rspec-expectations (~> 3.8.0) - rspec-mocks (~> 3.8.0) - rspec-core (3.8.0) - rspec-support (~> 3.8.0) - rspec-expectations (3.8.2) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-mocks (3.8.0) - diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.8.0) - rspec-support (3.8.0) - rspec_candy (0.5.1) - rspec - sneaky-save - sneaky-save (0.1.3) - activerecord (>= 3.2.0) - tzinfo (2.0.4) - concurrent-ruby (~> 1.0) - zeitwerk (2.4.2) - -PLATFORMS - ruby - -DEPENDENCIES - activerecord (~> 6.1.3) - assignable_values! - database_cleaner - gemika (~> 0.8.0) - i18n - pg (~> 1.3.5) - rake - rspec - rspec_candy - -BUNDLED WITH - 2.2.15 diff --git a/Gemfile.7.1.mysql2.lock b/Gemfile.7.1.mysql2.lock index 0f2e0f1..b2d1896 100644 --- a/Gemfile.7.1.mysql2.lock +++ b/Gemfile.7.1.mysql2.lock @@ -85,4 +85,4 @@ DEPENDENCIES rspec_candy BUNDLED WITH - 2.2.15 + 2.7.2 diff --git a/Gemfile.7.1.pg.lock b/Gemfile.7.1.pg.lock index d955a4b..d0f6434 100644 --- a/Gemfile.7.1.pg.lock +++ b/Gemfile.7.1.pg.lock @@ -81,4 +81,4 @@ DEPENDENCIES rspec_candy BUNDLED WITH - 2.2.15 + 2.7.2 diff --git a/Gemfile.6.1.mysql2 b/Gemfile.7.2.mysql2 similarity index 89% rename from Gemfile.6.1.mysql2 rename to Gemfile.7.2.mysql2 index 9983f1c..197c013 100644 --- a/Gemfile.6.1.mysql2 +++ b/Gemfile.7.2.mysql2 @@ -1,7 +1,7 @@ source 'https://rubygems.org' # Runtime dependencies -gem 'activerecord', '~>6.1.3' +gem 'activerecord', '~>7.2.0' gem 'i18n' gem 'mysql2' diff --git a/Gemfile.7.2.mysql2.lock b/Gemfile.7.2.mysql2.lock new file mode 100644 index 0000000..e0d34a5 --- /dev/null +++ b/Gemfile.7.2.mysql2.lock @@ -0,0 +1,90 @@ +PATH + remote: . + specs: + assignable_values (1.1.1) + activerecord (>= 2.3) + +GEM + remote: https://rubygems.org/ + specs: + activemodel (7.2.3) + activesupport (= 7.2.3) + activerecord (7.2.3) + activemodel (= 7.2.3) + activesupport (= 7.2.3) + timeout (>= 0.4.0) + activesupport (7.2.3) + 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) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.0.1) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + database_cleaner (2.1.0) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.2.2) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0) + database_cleaner-core (2.0.1) + diff-lcs (1.6.2) + drb (2.2.3) + gemika (0.8.4) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + logger (1.7.0) + minitest (6.0.0) + prism (~> 1.5) + mysql2 (0.5.7) + bigdecimal + prism (1.6.0) + rake (13.3.1) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.7) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.6) + rspec_candy (0.5.1) + rspec + sneaky-save + securerandom (0.4.1) + sneaky-save (0.1.3) + activerecord (>= 3.2.0) + timeout (0.6.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + +PLATFORMS + ruby + x86_64-linux + +DEPENDENCIES + activerecord (~> 7.2.0) + assignable_values! + database_cleaner + gemika (~> 0.8.0) + i18n + mysql2 + rake + rspec + rspec_candy + +BUNDLED WITH + 2.7.2 diff --git a/Gemfile.6.1.pg b/Gemfile.7.2.pg similarity index 89% rename from Gemfile.6.1.pg rename to Gemfile.7.2.pg index 3cd32a5..f9ddade 100644 --- a/Gemfile.6.1.pg +++ b/Gemfile.7.2.pg @@ -1,7 +1,7 @@ source 'https://rubygems.org' # Runtime dependencies -gem 'activerecord', '~>6.1.3' +gem 'activerecord', '~>7.2.0' gem 'i18n' gem 'pg', '~> 1.3.5' diff --git a/Gemfile.7.2.pg.lock b/Gemfile.7.2.pg.lock new file mode 100644 index 0000000..471b3ac --- /dev/null +++ b/Gemfile.7.2.pg.lock @@ -0,0 +1,89 @@ +PATH + remote: . + specs: + assignable_values (1.1.1) + activerecord (>= 2.3) + +GEM + remote: https://rubygems.org/ + specs: + activemodel (7.2.3) + activesupport (= 7.2.3) + activerecord (7.2.3) + activemodel (= 7.2.3) + activesupport (= 7.2.3) + timeout (>= 0.4.0) + activesupport (7.2.3) + 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) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.0.1) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + database_cleaner (2.1.0) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.2.2) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0) + database_cleaner-core (2.0.1) + diff-lcs (1.6.2) + drb (2.2.3) + gemika (0.8.4) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + logger (1.7.0) + minitest (6.0.0) + prism (~> 1.5) + pg (1.3.5) + prism (1.6.0) + rake (13.3.1) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.7) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.6) + rspec_candy (0.5.1) + rspec + sneaky-save + securerandom (0.4.1) + sneaky-save (0.1.3) + activerecord (>= 3.2.0) + timeout (0.6.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + +PLATFORMS + ruby + x86_64-linux + +DEPENDENCIES + activerecord (~> 7.2.0) + assignable_values! + database_cleaner + gemika (~> 0.8.0) + i18n + pg (~> 1.3.5) + rake + rspec + rspec_candy + +BUNDLED WITH + 2.7.2 diff --git a/Gemfile.8.0.mysql2 b/Gemfile.8.0.mysql2 new file mode 100644 index 0000000..e0411f0 --- /dev/null +++ b/Gemfile.8.0.mysql2 @@ -0,0 +1,16 @@ +source 'https://rubygems.org' + +# Runtime dependencies +gem 'activerecord', '~>8.0.0' +gem 'i18n' +gem 'mysql2' + +# Development dependencies +gem 'rake' +gem 'database_cleaner' +gem 'rspec' +gem 'rspec_candy' +gem 'gemika', '~> 0.8.0' + +# Gem under test +gem 'assignable_values', :path => '.' diff --git a/Gemfile.8.0.mysql2.lock b/Gemfile.8.0.mysql2.lock new file mode 100644 index 0000000..5e6fb58 --- /dev/null +++ b/Gemfile.8.0.mysql2.lock @@ -0,0 +1,92 @@ +PATH + remote: . + specs: + assignable_values (1.1.1) + activerecord (>= 2.3) + +GEM + remote: https://rubygems.org/ + specs: + activemodel (8.0.4) + activesupport (= 8.0.4) + activerecord (8.0.4) + activemodel (= 8.0.4) + activesupport (= 8.0.4) + timeout (>= 0.4.0) + activesupport (8.0.4) + 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) + base64 (0.3.0) + benchmark (0.5.0) + bigdecimal (4.0.1) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + database_cleaner (2.1.0) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.2.2) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0) + database_cleaner-core (2.0.1) + diff-lcs (1.6.2) + drb (2.2.3) + gemika (0.8.4) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + logger (1.7.0) + minitest (6.0.0) + prism (~> 1.5) + mysql2 (0.5.7) + bigdecimal + prism (1.6.0) + rake (13.3.1) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.7) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.6) + rspec_candy (0.5.1) + rspec + sneaky-save + securerandom (0.4.1) + sneaky-save (0.1.3) + activerecord (>= 3.2.0) + timeout (0.6.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uri (1.1.1) + +PLATFORMS + ruby + x86_64-linux + +DEPENDENCIES + activerecord (~> 8.0.0) + assignable_values! + database_cleaner + gemika (~> 0.8.0) + i18n + mysql2 + rake + rspec + rspec_candy + +BUNDLED WITH + 2.7.2 diff --git a/Gemfile.8.0.pg.lock b/Gemfile.8.0.pg.lock index 5f64ad6..d043d2d 100644 --- a/Gemfile.8.0.pg.lock +++ b/Gemfile.8.0.pg.lock @@ -86,4 +86,4 @@ DEPENDENCIES rspec_candy BUNDLED WITH - 2.5.22 + 2.7.2 diff --git a/Gemfile.8.1.mysql2 b/Gemfile.8.1.mysql2 new file mode 100644 index 0000000..e933259 --- /dev/null +++ b/Gemfile.8.1.mysql2 @@ -0,0 +1,16 @@ +source 'https://rubygems.org' + +# Runtime dependencies +gem 'activerecord', '~>8.1.0' +gem 'i18n' +gem 'mysql2' + +# Development dependencies +gem 'rake' +gem 'database_cleaner' +gem 'rspec' +gem 'rspec_candy' +gem 'gemika', '~> 0.8.0' + +# Gem under test +gem 'assignable_values', :path => '.' diff --git a/Gemfile.8.1.mysql2.lock b/Gemfile.8.1.mysql2.lock new file mode 100644 index 0000000..68482af --- /dev/null +++ b/Gemfile.8.1.mysql2.lock @@ -0,0 +1,91 @@ +PATH + remote: . + specs: + assignable_values (1.1.1) + activerecord (>= 2.3) + +GEM + remote: https://rubygems.org/ + specs: + activemodel (8.1.1) + activesupport (= 8.1.1) + activerecord (8.1.1) + activemodel (= 8.1.1) + activesupport (= 8.1.1) + timeout (>= 0.4.0) + activesupport (8.1.1) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + base64 (0.3.0) + bigdecimal (4.0.1) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + database_cleaner (2.1.0) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.2.2) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0) + database_cleaner-core (2.0.1) + diff-lcs (1.6.2) + drb (2.2.3) + gemika (0.8.4) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + json (2.18.0) + logger (1.7.0) + minitest (6.0.0) + prism (~> 1.5) + mysql2 (0.5.7) + bigdecimal + prism (1.6.0) + rake (13.3.1) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.7) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.6) + rspec_candy (0.5.1) + rspec + sneaky-save + securerandom (0.4.1) + sneaky-save (0.1.3) + activerecord (>= 3.2.0) + timeout (0.6.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uri (1.1.1) + +PLATFORMS + ruby + +DEPENDENCIES + activerecord (~> 8.1.0) + assignable_values! + database_cleaner + gemika (~> 0.8.0) + i18n + mysql2 + rake + rspec + rspec_candy + +BUNDLED WITH + 2.7.2 diff --git a/Gemfile.8.1.pg b/Gemfile.8.1.pg new file mode 100644 index 0000000..d53c95f --- /dev/null +++ b/Gemfile.8.1.pg @@ -0,0 +1,16 @@ +source 'https://rubygems.org' + +# Runtime dependencies +gem 'activerecord', '~>8.1.0' +gem 'i18n' +gem 'pg' + +# Development dependencies +gem 'rake' +gem 'database_cleaner' +gem 'rspec' +gem 'rspec_candy' +gem 'gemika', '~> 0.8.0' + +# Gem under test +gem 'assignable_values', :path => '.' diff --git a/Gemfile.8.1.pg.lock b/Gemfile.8.1.pg.lock new file mode 100644 index 0000000..2ac06ef --- /dev/null +++ b/Gemfile.8.1.pg.lock @@ -0,0 +1,91 @@ +PATH + remote: . + specs: + assignable_values (1.1.1) + activerecord (>= 2.3) + +GEM + remote: https://rubygems.org/ + specs: + activemodel (8.1.1) + activesupport (= 8.1.1) + activerecord (8.1.1) + activemodel (= 8.1.1) + activesupport (= 8.1.1) + timeout (>= 0.4.0) + activesupport (8.1.1) + base64 + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb + i18n (>= 1.6, < 2) + json + logger (>= 1.4.2) + minitest (>= 5.1) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + base64 (0.3.0) + bigdecimal (4.0.1) + concurrent-ruby (1.3.6) + connection_pool (3.0.2) + database_cleaner (2.1.0) + database_cleaner-active_record (>= 2, < 3) + database_cleaner-active_record (2.2.2) + activerecord (>= 5.a) + database_cleaner-core (~> 2.0) + database_cleaner-core (2.0.1) + diff-lcs (1.6.2) + drb (2.2.3) + gemika (0.8.4) + i18n (1.14.7) + concurrent-ruby (~> 1.0) + json (2.18.0) + logger (1.7.0) + minitest (6.0.0) + prism (~> 1.5) + pg (1.6.2) + prism (1.6.0) + rake (13.3.1) + rspec (3.13.2) + rspec-core (~> 3.13.0) + rspec-expectations (~> 3.13.0) + rspec-mocks (~> 3.13.0) + rspec-core (3.13.6) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.5) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.7) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.13.0) + rspec-support (3.13.6) + rspec_candy (0.5.1) + rspec + sneaky-save + securerandom (0.4.1) + sneaky-save (0.1.3) + activerecord (>= 3.2.0) + timeout (0.6.0) + tzinfo (2.0.6) + concurrent-ruby (~> 1.0) + uri (1.1.1) + +PLATFORMS + ruby + x86_64-linux + +DEPENDENCIES + activerecord (~> 8.1.0) + assignable_values! + database_cleaner + gemika (~> 0.8.0) + i18n + pg + rake + rspec + rspec_candy + +BUNDLED WITH + 2.7.2 diff --git a/Gemfile.lock b/Gemfile.lock index ebe8f1e..0f451c1 120000 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1 +1 @@ -Gemfile.7.1.pg.lock \ No newline at end of file +Gemfile.8.1.pg.lock \ No newline at end of file diff --git a/README.md b/README.md index dd783bc..c5a7c42 100644 --- a/README.md +++ b/README.md @@ -443,7 +443,7 @@ Development There are tests in `spec`. We only accept PRs with tests. To run tests: -- Install Ruby 3.3.0 +- Install Ruby 3.4.7 - Create a local test database `assignable_values_test` in both MySQL and PostgreSQL (see `.github/workflows/test.yml` for commands to do so) - Copy `spec/support/database.sample.yml` to `spec/support/database.yml` and enter your local From b5a63ca0458f1f43b236e67e24cbc0cb6c1717ee Mon Sep 17 00:00:00 2001 From: Florian Leinsinger Date: Thu, 18 Dec 2025 15:39:43 +0100 Subject: [PATCH 2/3] =?UTF-8?q?[D-391]=20Fehler=20in=20assignable=5Fvalues?= =?UTF-8?q?=20f=C3=BCr=20nicht=20pluralisierbare=20Attribute?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: https://linear.app/makandra/issue/D-391/fehler-in-assignable-values-fur-nicht-pluralisierbare-attribute --- lib/assignable_values.rb | 1 - .../active_record/restriction/base.rb | 11 ---- .../restriction/scalar_attribute.rb | 19 ------- lib/assignable_values/humanizable_string.rb | 15 ------ spec/assignable_values/active_record_spec.rb | 52 ------------------- 5 files changed, 98 deletions(-) delete mode 100644 lib/assignable_values/humanizable_string.rb diff --git a/lib/assignable_values.rb b/lib/assignable_values.rb index 34fe565..1d8ff8f 100644 --- a/lib/assignable_values.rb +++ b/lib/assignable_values.rb @@ -7,4 +7,3 @@ require 'assignable_values/active_record/restriction/scalar_attribute' require 'assignable_values/active_record/restriction/store_accessor_attribute' require 'assignable_values/humanized_value' -require 'assignable_values/humanizable_string' diff --git a/lib/assignable_values/active_record/restriction/base.rb b/lib/assignable_values/active_record/restriction/base.rb index c4c0b8e..03ea075 100644 --- a/lib/assignable_values/active_record/restriction/base.rb +++ b/lib/assignable_values/active_record/restriction/base.rb @@ -7,7 +7,6 @@ class Base SUPPORTED_OPTIONS = [ :allow_blank, - :decorate, :default, :include_old_value, :message, @@ -75,11 +74,6 @@ def assignable_values(record, options = {}) end end - if options[:decorate] - current_values = decorate_values(current_values, record.class) - additional_assignable_values = decorate_values(additional_assignable_values, record.class) - end - if additional_assignable_values.present? # will not keep current_values scoped additional_assignable_values | current_values @@ -159,10 +153,6 @@ def previously_saved_value(record) raise NotImplementedError end - def decorate_values(values, _klass) - values - end - def delegate? @options.has_key?(:through) end @@ -242,7 +232,6 @@ def define_assignable_values_method define_method assignable_values_method do |*args| # Ruby 1.8.7 does not support optional block arguments :( options = args.first || {} - options.merge!({:decorate => true}) restriction.assignable_values(self, options) end end diff --git a/lib/assignable_values/active_record/restriction/scalar_attribute.rb b/lib/assignable_values/active_record/restriction/scalar_attribute.rb index 75fd1b1..92547ee 100644 --- a/lib/assignable_values/active_record/restriction/scalar_attribute.rb +++ b/lib/assignable_values/active_record/restriction/scalar_attribute.rb @@ -80,29 +80,10 @@ def define_humanized_value_instance_method def define_humanized_assignable_values_instance_method restriction = self - multiple = @options[:multiple] enhance_model do define_method :"humanized_assignable_#{restriction.property.to_s.pluralize}" do |*args| restriction.humanized_assignable_values(self, *args) end - - unless multiple - define_method :"humanized_#{restriction.property.to_s.pluralize}" do - ActiveSupport::Deprecation.new.warn("humanized_s is deprecated, use humanized_assignable_s instead", caller) - restriction.humanized_assignable_values(self) - end - end - end - end - - def decorate_values(values, klass) - restriction = self - values.collect do |value| - if value.is_a?(String) - humanization = restriction.humanized_value(klass, value) - value = HumanizableString.new(value, humanization) - end - value end end diff --git a/lib/assignable_values/humanizable_string.rb b/lib/assignable_values/humanizable_string.rb deleted file mode 100644 index 96dfe73..0000000 --- a/lib/assignable_values/humanizable_string.rb +++ /dev/null @@ -1,15 +0,0 @@ -# A String that responds to #humanized. -# Earlier versions of assignable_values dependent on such an API. -class HumanizableString < String - - def initialize(string, humanization) - super(string) - @humanization = humanization - end - - def humanized - ActiveSupport::Deprecation.new.warn("assignable_.humanized is deprecated, use humanized_assignable_s.humanized instead", caller) - @humanization - end - -end diff --git a/spec/assignable_values/active_record_spec.rb b/spec/assignable_values/active_record_spec.rb index 67a56f8..5123837 100644 --- a/spec/assignable_values/active_record_spec.rb +++ b/spec/assignable_values/active_record_spec.rb @@ -1269,58 +1269,6 @@ def genres end - context 'legacy methods for API compatibility' do - - it 'should define a method that return pairs of values and their humanization' do - klass = Song.disposable_copy do - assignable_values_for :genre do - %w[pop rock] - end - end - deprecation_instance = instance_double(ActiveSupport::Deprecation) - allow(ActiveSupport::Deprecation).to receive(:new).and_return(deprecation_instance) - allow(deprecation_instance).to receive(:warn) - - genres = klass.new.humanized_genres - genres.collect(&:humanized).should == ['Pop music', 'Rock music'] - - expect(deprecation_instance).to have_received(:warn).with( - "humanized_s is deprecated, use humanized_assignable_s instead", - instance_of(Array) - ) - end - - it "should define a method #humanized on assignable string values, which return up the value's' translation" do - klass = Song.disposable_copy do - assignable_values_for :genre do - %w[pop rock] - end - end - deprecation_instance = instance_double(ActiveSupport::Deprecation) - allow(ActiveSupport::Deprecation).to receive(:new).and_return(deprecation_instance) - allow(deprecation_instance).to receive(:warn) - - klass.new.assignable_genres.collect(&:humanized).should == ['Pop music', 'Rock music'] - - expect(deprecation_instance).to have_received(:warn).with( - "assignable_.humanized is deprecated, use humanized_assignable_s.humanized instead", - instance_of(Array) - ).at_least(:once) - end - - it 'should not define a method #humanized on values that are not strings' do - klass = Song.disposable_copy do - assignable_values_for :year do - [1999, 2000, 2001] - end - end - years = klass.new.assignable_years - years.should == [1999, 2000, 2001] - years.first.should_not respond_to(:humanized) - end - - end - end context 'with :through option' do From 2c0de4d0cc80accc138f792eaea9866c72c0d896 Mon Sep 17 00:00:00 2001 From: Florian Leinsinger Date: Thu, 18 Dec 2025 16:13:08 +0100 Subject: [PATCH 3/3] Release version 2.0.0 --- CHANGELOG.md | 8 ++++++++ Gemfile.7.1.mysql2.lock | 2 +- Gemfile.7.1.pg.lock | 2 +- Gemfile.7.2.mysql2.lock | 2 +- Gemfile.7.2.pg.lock | 2 +- Gemfile.8.0.mysql2.lock | 2 +- Gemfile.8.0.pg.lock | 2 +- Gemfile.8.1.mysql2.lock | 2 +- Gemfile.8.1.pg.lock | 2 +- lib/assignable_values/version.rb | 2 +- 10 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c59e716..d050c99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,14 @@ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html - +## 1.2.0 - 2025-12-18 + +### Breaking changes + +- Drop support for Ruby < 3.1, Rails < 7. +- Removed legacy accessor methods `humanized_s` (deprecated since 0.15.0). Use `humanized_assignable_s` instead. +- Removed `humanized` method on string values returned by assignable_values. + ## 1.1.1 - 2025-01-09 ### Compatible changes diff --git a/Gemfile.7.1.mysql2.lock b/Gemfile.7.1.mysql2.lock index b2d1896..2f1b7ce 100644 --- a/Gemfile.7.1.mysql2.lock +++ b/Gemfile.7.1.mysql2.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - assignable_values (1.1.1) + assignable_values (2.0.0) activerecord (>= 2.3) GEM diff --git a/Gemfile.7.1.pg.lock b/Gemfile.7.1.pg.lock index d0f6434..87f2a8f 100644 --- a/Gemfile.7.1.pg.lock +++ b/Gemfile.7.1.pg.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - assignable_values (1.1.1) + assignable_values (2.0.0) activerecord (>= 2.3) GEM diff --git a/Gemfile.7.2.mysql2.lock b/Gemfile.7.2.mysql2.lock index e0d34a5..e0fc3d6 100644 --- a/Gemfile.7.2.mysql2.lock +++ b/Gemfile.7.2.mysql2.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - assignable_values (1.1.1) + assignable_values (2.0.0) activerecord (>= 2.3) GEM diff --git a/Gemfile.7.2.pg.lock b/Gemfile.7.2.pg.lock index 471b3ac..89bc339 100644 --- a/Gemfile.7.2.pg.lock +++ b/Gemfile.7.2.pg.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - assignable_values (1.1.1) + assignable_values (2.0.0) activerecord (>= 2.3) GEM diff --git a/Gemfile.8.0.mysql2.lock b/Gemfile.8.0.mysql2.lock index 5e6fb58..5fcff6e 100644 --- a/Gemfile.8.0.mysql2.lock +++ b/Gemfile.8.0.mysql2.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - assignable_values (1.1.1) + assignable_values (2.0.0) activerecord (>= 2.3) GEM diff --git a/Gemfile.8.0.pg.lock b/Gemfile.8.0.pg.lock index d043d2d..f7ec4ed 100644 --- a/Gemfile.8.0.pg.lock +++ b/Gemfile.8.0.pg.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - assignable_values (1.1.1) + assignable_values (2.0.0) activerecord (>= 2.3) GEM diff --git a/Gemfile.8.1.mysql2.lock b/Gemfile.8.1.mysql2.lock index 68482af..b92051f 100644 --- a/Gemfile.8.1.mysql2.lock +++ b/Gemfile.8.1.mysql2.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - assignable_values (1.1.1) + assignable_values (2.0.0) activerecord (>= 2.3) GEM diff --git a/Gemfile.8.1.pg.lock b/Gemfile.8.1.pg.lock index 2ac06ef..353849e 100644 --- a/Gemfile.8.1.pg.lock +++ b/Gemfile.8.1.pg.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - assignable_values (1.1.1) + assignable_values (2.0.0) activerecord (>= 2.3) GEM diff --git a/lib/assignable_values/version.rb b/lib/assignable_values/version.rb index 683919a..7f8c83d 100644 --- a/lib/assignable_values/version.rb +++ b/lib/assignable_values/version.rb @@ -1,3 +1,3 @@ module AssignableValues - VERSION = '1.1.1' + VERSION = '2.0.0' end