Skip to content

Commit 536716a

Browse files
otherguybyroot
authored andcommitted
Remove multi_json and replace with StdLib JSON
Fix: #213
1 parent 734c38f commit 536716a

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

activerecord-session_store.gemspec

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ Gem::Specification.new do |s|
2323
s.add_dependency('actionpack', '>= 6.1')
2424
s.add_dependency('railties', '>= 6.1')
2525
s.add_dependency('rack', '>= 2.0.8', '< 4')
26-
s.add_dependency('multi_json', '~> 1.11', '>= 1.11.2')
2726
s.add_dependency('cgi', '>= 0.3.6')
2827

2928
s.add_development_dependency('sqlite3')

lib/active_record/session_store.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
require 'active_record/session_store/version'
33
require 'action_dispatch/session/active_record_store'
44
require 'active_support/core_ext/hash/keys'
5-
require 'multi_json'
5+
require 'json'
66

77
module ActiveRecord
88
module SessionStore
@@ -62,12 +62,12 @@ def self.dump(value)
6262
# Uses built-in JSON library to encode/decode session
6363
class JsonSerializer
6464
def self.load(value)
65-
hash = MultiJson.load(value)
65+
hash = JSON.parse(value)
6666
hash.is_a?(Hash) ? hash.with_indifferent_access[:value] : hash
6767
end
6868

6969
def self.dump(value)
70-
MultiJson.dump(value: value)
70+
JSON.dump(value: value)
7171
end
7272
end
7373

0 commit comments

Comments
 (0)