globalize 6.2.0 → 6.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cabd646999269152beb8dc97eafa531bdd0627206b113c8ce7e90a17343a0369
4
- data.tar.gz: 8fa08f217088f91bcb62e2b1667feefbc0833de0406b353890ba75568f506681
3
+ metadata.gz: dea2f69ccf135fbe06acbc84c800b55e86c91ec4af79d7bfee2f633f707e2dce
4
+ data.tar.gz: '08fb1fece6efe2c8ef6c3269a6db1d816374e680facedf771ab3bad361a01fa6'
5
5
  SHA512:
6
- metadata.gz: dbf148ebedffe9847a05e31053400cbe0d3e4292689704143b68ca2884a8464d4703fb6bd4ef142551b8ddd3091c650da0142a75eca871d348d9576861d855ce
7
- data.tar.gz: a408491fb728aa2692f1ee7b71cb546ad0fc747f1f754bf779221af51b122c2442b530efc067b00fc768d56e1b80a2b09fcc0f124e2eaae7bffcca3a6af3d106
6
+ metadata.gz: ae62da6d81f0a0deecf81985717bcc565d4a6b105483dcf0234f842c0954e3c66dc9f277be67f6119b35766cbcfdbb5cc2eb881c5be8562c650ff972484e4290
7
+ data.tar.gz: 82e457b56e752a61748cb2f6684f96daa6387915addad2414749fd90504ad3e42e426c002f4c14bc78a440c62927e61dfddef46d489b1c627f75d1d5616826f9
checksums.yaml.gz.sig CHANGED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Globalize Changelog
2
2
 
3
+ ## 6.2.1 (2022-05-24)
4
+
5
+ * Changed serialize method in Rails 6.1.0+ [#798](https://github.com/globalize/globalize/pull/798) by [Alex](https://github.com/oivoodoo)
6
+
3
7
  ## 6.2.0 (2022-05-24)
4
8
 
5
9
  * Fix asset precompile in docker build workflow [#799](https://github.com/globalize/globalize/pull/799) by [Diefferson Koderer Môro](https://github.com/djpremier)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- globalize (6.2.0)
4
+ globalize (6.2.1)
5
5
  activemodel (>= 4.2, < 7.1)
6
6
  activerecord (>= 4.2, < 7.1)
7
7
  request_store (~> 1.0)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Globalize
4
- Version = '6.2.0'
4
+ Version = '6.2.1'
5
5
  end
@@ -0,0 +1,22 @@
1
+ module Globalize
2
+ module AttributeMethods
3
+ module Serialization
4
+ def serialize(attr_name, class_name_or_coder = Object, **options)
5
+ super(attr_name, class_name_or_coder, **options)
6
+
7
+ coder = if class_name_or_coder == ::JSON
8
+ ::ActiveRecord::Coders::JSON
9
+ elsif [:load, :dump].all? { |x| class_name_or_coder.respond_to?(x) }
10
+ class_name_or_coder
11
+ else
12
+ ::ActiveRecord::Coders::YAMLColumn.new(attr_name, class_name_or_coder)
13
+ end
14
+
15
+ self.globalize_serialized_attributes = globalize_serialized_attributes.dup
16
+ self.globalize_serialized_attributes[attr_name] = coder
17
+ end
18
+ end
19
+ end
20
+ end
21
+
22
+ ActiveRecord::AttributeMethods::Serialization::ClassMethods.send(:prepend, Globalize::AttributeMethods::Serialization)
@@ -1,5 +1,7 @@
1
1
  if ::ActiveRecord.version < Gem::Version.new("5.1.0")
2
2
  require_relative 'rails4/serialization'
3
- else
3
+ elsif ::ActiveRecord.version < Gem::Version.new("6.1.0")
4
4
  require_relative 'rails5_1/serialization'
5
+ else
6
+ require_relative 'rails6_1/serialization'
5
7
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: globalize
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.2.0
4
+ version: 6.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
@@ -249,6 +249,7 @@ files:
249
249
  - lib/patches/active_record/rails5/uniqueness_validator.rb
250
250
  - lib/patches/active_record/rails5_1/serialization.rb
251
251
  - lib/patches/active_record/rails5_1/uniqueness_validator.rb
252
+ - lib/patches/active_record/rails6_1/serialization.rb
252
253
  - lib/patches/active_record/rails6_1/uniqueness_validator.rb
253
254
  - lib/patches/active_record/relation.rb
254
255
  - lib/patches/active_record/serialization.rb
metadata.gz.sig CHANGED
Binary file