From 54439299812cca67f7984da5ab1d9bc229752a36 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 8 Mar 2024 10:52:14 +0100 Subject: [PATCH 1/6] Remove multi_json and replace with StdLib JSON --- lib/active_record/session_store.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/active_record/session_store.rb b/lib/active_record/session_store.rb index 966bf4a..2a11d73 100644 --- a/lib/active_record/session_store.rb +++ b/lib/active_record/session_store.rb @@ -2,7 +2,7 @@ require 'active_record/session_store/version' require 'action_dispatch/session/active_record_store' require 'active_support/core_ext/hash/keys' -require 'multi_json' +require 'json' module ActiveRecord module SessionStore @@ -62,12 +62,12 @@ def self.dump(value) # Uses built-in JSON library to encode/decode session class JsonSerializer def self.load(value) - hash = MultiJson.load(value) + hash = JSON.load(value) hash.is_a?(Hash) ? hash.with_indifferent_access[:value] : hash end def self.dump(value) - MultiJson.dump(value: value) + JSON.dump(value: value) end end From 1ac5840511c833a5f87b5c1a1db3870c1a2b1246 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 8 Mar 2024 10:53:11 +0100 Subject: [PATCH 2/6] Remove multi-json from activerecord-session_store.gemspec --- activerecord-session_store.gemspec | 1 - 1 file changed, 1 deletion(-) diff --git a/activerecord-session_store.gemspec b/activerecord-session_store.gemspec index 6175768..af8296e 100644 --- a/activerecord-session_store.gemspec +++ b/activerecord-session_store.gemspec @@ -23,7 +23,6 @@ Gem::Specification.new do |s| s.add_dependency('actionpack', '>= 6.1') s.add_dependency('railties', '>= 6.1') s.add_dependency('rack', '>= 2.0.8', '< 4') - s.add_dependency('multi_json', '~> 1.11', '>= 1.11.2') s.add_dependency('cgi', '>= 0.3.6') s.add_development_dependency('sqlite3') From 8cd7396ee7b903510671759ab4f8253d699c86aa Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 8 Mar 2024 11:11:32 +0100 Subject: [PATCH 3/6] Update CI config --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ba234e..1e3b621 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,8 +7,13 @@ jobs: strategy: fail-fast: false matrix: - ruby: ['2.7', '3.0', '3.1'] - rails: ['6.1', '7.0', 'edge'] + ruby: ['2.7', '3.0', '3.1', '3.2', '3.3'] + rails: ['6.1', '7.0', '7.1', 'edge'] + exclude: + - ruby: '2.7' + rails: 'edge' + - ruby: '3.0' + rails: 'edge' env: BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails }}.gemfile name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} From f8654bd1327d42cf5de0a11a951b1fcfd1b5b8cd Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 8 Mar 2024 11:13:10 +0100 Subject: [PATCH 4/6] Add Rails 7.1 gemfile --- gemfiles/rails_7.1.gemfile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 gemfiles/rails_7.1.gemfile diff --git a/gemfiles/rails_7.1.gemfile b/gemfiles/rails_7.1.gemfile new file mode 100644 index 0000000..0945d76 --- /dev/null +++ b/gemfiles/rails_7.1.gemfile @@ -0,0 +1,8 @@ +source "https://rubygems.org" + +gem "actionpack", github: "rails/rails", branch: "7-1-stable" +gem "activerecord", github: "rails/rails", branch: "7-1-stable" +gem "railties", github: "rails/rails", branch: "7-1-stable" +gem "rack", ">= 2.2.4", "< 4" + +gemspec :path => "../" From a1a8f880c62f37ed4df43da4089fe31b551f3774 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Fri, 8 Mar 2024 11:20:29 +0100 Subject: [PATCH 5/6] Update CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e3b621..77af3e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: name: Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }} steps: - name: Check out code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up Ruby ${{ matrix.ruby }} uses: ruby/setup-ruby@v1 with: From 43f039cce3b0f22cf169c579e85eba6bc60c32f0 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 4 Sep 2024 16:12:24 +0100 Subject: [PATCH 6/6] Replace JSON.load with JSON.parse --- lib/active_record/session_store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_record/session_store.rb b/lib/active_record/session_store.rb index 2a11d73..4f56c5e 100644 --- a/lib/active_record/session_store.rb +++ b/lib/active_record/session_store.rb @@ -62,7 +62,7 @@ def self.dump(value) # Uses built-in JSON library to encode/decode session class JsonSerializer def self.load(value) - hash = JSON.load(value) + hash = JSON.parse(value) hash.is_a?(Hash) ? hash.with_indifferent_access[:value] : hash end