globalize 6.2.1 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/Appraisals +3 -14
  3. data/CHANGELOG.md +11 -0
  4. data/CONTRIBUTING.md +2 -4
  5. data/Gemfile +8 -0
  6. data/Gemfile.lock +56 -40
  7. data/README.md +37 -47
  8. data/Rakefile +22 -17
  9. data/lib/globalize/active_record/act_macro.rb +20 -22
  10. data/lib/globalize/active_record/adapter_dirty.rb +2 -11
  11. data/lib/globalize/active_record/class_methods.rb +7 -8
  12. data/lib/globalize/active_record/instance_methods.rb +21 -56
  13. data/lib/globalize/active_record/migration.rb +7 -21
  14. data/lib/globalize/active_record/translated_attributes_query.rb +0 -17
  15. data/lib/globalize/version.rb +1 -1
  16. data/lib/globalize.rb +14 -34
  17. data/lib/patches/active_record/rails7_1/serialization.rb +28 -0
  18. data/lib/patches/active_record/rails7_2/serialization.rb +15 -0
  19. data/lib/patches/active_record/relation.rb +11 -15
  20. data/lib/patches/active_record/serialization.rb +5 -5
  21. data/lib/patches/active_record/uniqueness_validator.rb +1 -9
  22. data/lib/patches/active_support/inflections.rb +8 -10
  23. metadata +38 -52
  24. checksums.yaml.gz.sig +0 -0
  25. data/docker-compose.yml +0 -22
  26. data/globalize.gemspec +0 -37
  27. data/issue_template.rb +0 -38
  28. data/lib/patches/active_record/query_method.rb +0 -3
  29. data/lib/patches/active_record/rails4/query_method.rb +0 -35
  30. data/lib/patches/active_record/rails4/serialization.rb +0 -22
  31. data/lib/patches/active_record/rails4/uniqueness_validator.rb +0 -42
  32. data/lib/patches/active_record/rails5/uniqueness_validator.rb +0 -47
  33. data/lib/patches/active_record/rails5_1/serialization.rb +0 -22
  34. data/lib/patches/active_record/rails5_1/uniqueness_validator.rb +0 -45
  35. data.tar.gz.sig +0 -0
  36. metadata.gz.sig +0 -0
@@ -17,24 +17,9 @@ module Globalize
17
17
  with_given_locale(attributes) { super(attributes.except("locale"), *options) }
18
18
  end
19
19
 
20
- if Globalize.rails_52?
21
-
22
- # In Rails 5.2 we need to override *_assign_attributes* as it's called earlier
23
- # in the stack (before *assign_attributes*)
24
- # See https://github.com/rails/rails/blob/5-2-stable/activerecord/lib/active_record/attribute_assignment.rb#L12
25
- def _assign_attributes(new_attributes)
26
- attributes = new_attributes.stringify_keys
27
- with_given_locale(attributes) { super(attributes.except("locale")) }
28
- end
29
-
30
- else
31
-
32
- def assign_attributes(new_attributes, *options)
33
- super unless new_attributes.respond_to?(:stringify_keys) && new_attributes.present?
34
- attributes = new_attributes.stringify_keys
35
- with_given_locale(attributes) { super(attributes.except("locale"), *options) }
36
- end
37
-
20
+ def _assign_attributes(new_attributes)
21
+ attributes = new_attributes.stringify_keys
22
+ with_given_locale(attributes) { super(attributes.except("locale")) }
38
23
  end
39
24
 
40
25
  def write_attribute(name, value, *args, &block)
@@ -158,23 +143,8 @@ module Globalize
158
143
  Globalize.fallbacks(locale)
159
144
  end
160
145
 
161
- if Globalize.ruby_27?
162
- class_eval <<~RUBY, __FILE__, __LINE__ + 1
163
- def save(...)
164
- result = Globalize.with_locale(translation.locale || I18n.default_locale) do
165
- without_fallbacks do
166
- super
167
- end
168
- end
169
- if result
170
- globalize.clear_dirty
171
- end
172
-
173
- result
174
- end
175
- RUBY
176
- else
177
- def save(*)
146
+ class_eval <<~RUBY, __FILE__, __LINE__ + 1
147
+ def save(...)
178
148
  result = Globalize.with_locale(translation.locale || I18n.default_locale) do
179
149
  without_fallbacks do
180
150
  super
@@ -186,7 +156,7 @@ module Globalize
186
156
 
187
157
  result
188
158
  end
189
- end
159
+ RUBY
190
160
 
191
161
  def column_for_attribute name
192
162
  return super if translated_attribute_names.exclude?(name)
@@ -202,34 +172,29 @@ module Globalize
202
172
  changed_attributes.present? || translations.any?(&:changed?)
203
173
  end
204
174
 
205
- if Globalize.rails_51?
206
- def saved_changes
207
- super.tap do |changes|
208
- translation = translation_for(::Globalize.locale, false)
209
- if translation
210
- translation_changes = translation.saved_changes.select { |name| translated?(name) }
211
- changes.merge!(translation_changes) if translation_changes.any?
212
- end
175
+ def saved_changes
176
+ super.tap do |changes|
177
+ translation = translation_for(::Globalize.locale, false)
178
+ if translation
179
+ translation_changes = translation.saved_changes.select { |name| translated?(name) }
180
+ changes.merge!(translation_changes) if translation_changes.any?
213
181
  end
214
182
  end
215
183
  end
216
184
 
217
- if Globalize.rails_6?
218
- def changed_attributes
219
- super.merge(globalize.changed_attributes(::Globalize.locale))
220
- end
185
+ def changed_attributes
186
+ super.merge(globalize.changed_attributes(::Globalize.locale))
187
+ end
221
188
 
222
- def changes
223
- super.merge(globalize.changes(::Globalize.locale))
224
- end
189
+ def changes
190
+ super.merge(globalize.changes(::Globalize.locale))
191
+ end
225
192
 
226
- def changed
227
- super.concat(globalize.changed).uniq
228
- end
193
+ def changed
194
+ super.concat(globalize.changed).uniq
229
195
  end
230
196
 
231
- # need to access instance variable directly since changed_attributes
232
- # is frozen as of Rails 4.2
197
+ # need to access instance variable directly since changed_attributes is frozen
233
198
  def original_changed_attributes
234
199
  @changed_attributes
235
200
  end
@@ -89,27 +89,13 @@ module Globalize
89
89
  end
90
90
  end
91
91
 
92
- if Globalize.rails_6?
93
- def add_translation_fields
94
- connection.change_table(translations_table_name) do |t|
95
- fields.each do |name, options|
96
- if options.is_a? Hash
97
- t.column name, options.delete(:type), **options
98
- else
99
- t.column name, options
100
- end
101
- end
102
- end
103
- end
104
- else
105
- def add_translation_fields
106
- connection.change_table(translations_table_name) do |t|
107
- fields.each do |name, options|
108
- if options.is_a? Hash
109
- t.column name, options.delete(:type), options
110
- else
111
- t.column name, options
112
- end
92
+ def add_translation_fields
93
+ connection.change_table(translations_table_name) do |t|
94
+ fields.each do |name, options|
95
+ if options.is_a? Hash
96
+ t.column name, options.delete(:type), **options
97
+ else
98
+ t.column name, options
113
99
  end
114
100
  end
115
101
  end
@@ -99,23 +99,6 @@ module Globalize
99
99
  end
100
100
  end
101
101
 
102
- if Globalize.rails_42?
103
- def where_values_hash(*args)
104
- return super unless respond_to?(:translations_table_name)
105
- equalities = respond_to?(:with_default_scope) ? with_default_scope.where_values : where_values
106
- equalities = equalities.grep(Arel::Nodes::Equality).find_all { |node|
107
- node.left.relation.name == translations_table_name
108
- }
109
-
110
- binds = Hash[bind_values.find_all(&:first).map { |column, v| [column.name, v] }]
111
-
112
- super.merge(Hash[equalities.map { |where|
113
- name = where.left.name
114
- [name, binds.fetch(name.to_s) { right = where.right; right.is_a?(Arel::Nodes::Casted) ? right.val : right }]
115
- }])
116
- end
117
- end
118
-
119
102
  def join_translations(relation = self)
120
103
  if relation.joins_values.include?(:translations)
121
104
  relation
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Globalize
4
- Version = '6.2.1'
4
+ Version = "7.0.0"
5
5
  end
data/lib/globalize.rb CHANGED
@@ -1,7 +1,6 @@
1
1
  require 'request_store'
2
2
  require 'active_record'
3
3
  require 'patches/active_record/xml_attribute_serializer'
4
- require 'patches/active_record/query_method'
5
4
  require 'patches/active_record/relation'
6
5
  require 'patches/active_record/serialization'
7
6
  require 'patches/active_record/uniqueness_validator'
@@ -12,14 +11,9 @@ module Globalize
12
11
  autoload :ActiveRecord, 'globalize/active_record'
13
12
  autoload :Interpolation, 'globalize/interpolation'
14
13
 
15
- ACTIVE_RECORD_50 = Gem::Version.new('5.0.0')
16
- ACTIVE_RECORD_51 = Gem::Version.new('5.1.0')
17
- ACTIVE_RECORD_52 = Gem::Version.new('5.2.0')
18
- ACTIVE_RECORD_60 = Gem::Version.new('6.0.0')
19
- ACTIVE_RECORD_61 = Gem::Version.new('6.1.0')
20
-
21
- CURRENT_RUBY = Gem::Version.new(RUBY_VERSION)
22
- RUBY_VERSION_27 = Gem::Version.new('2.7.0')
14
+ ACTIVE_RECORD_7 = Gem::Version.new('7.0.0')
15
+ ACTIVE_RECORD_71 = Gem::Version.new('7.1.0')
16
+ ACTIVE_RECORD_72 = Gem::Version.new('7.2.0')
23
17
 
24
18
  class << self
25
19
  def locale
@@ -68,32 +62,16 @@ module Globalize
68
62
  RequestStore.store
69
63
  end
70
64
 
71
- def ruby_27?
72
- CURRENT_RUBY >= RUBY_VERSION_27
73
- end
74
-
75
- def rails_42?
76
- ::ActiveRecord.version < ACTIVE_RECORD_50
77
- end
78
-
79
- def rails_5?
80
- ::ActiveRecord.version >= ACTIVE_RECORD_50
65
+ def rails_7?
66
+ ::ActiveRecord.version >= ACTIVE_RECORD_7
81
67
  end
82
68
 
83
- def rails_51?
84
- ::ActiveRecord.version >= ACTIVE_RECORD_51
69
+ def rails_7_1?
70
+ ::ActiveRecord.version >= ACTIVE_RECORD_71
85
71
  end
86
72
 
87
- def rails_52?
88
- ::ActiveRecord.version >= ACTIVE_RECORD_52
89
- end
90
-
91
- def rails_6?
92
- ::ActiveRecord.version >= ACTIVE_RECORD_60
93
- end
94
-
95
- def rails_61?
96
- ::ActiveRecord.version >= ACTIVE_RECORD_61
73
+ def rails_7_2?
74
+ ::ActiveRecord.version >= ACTIVE_RECORD_72
97
75
  end
98
76
 
99
77
  protected
@@ -122,7 +100,9 @@ module Globalize
122
100
  end
123
101
  end
124
102
 
125
- ActiveRecord::Base.class_attribute :globalize_serialized_attributes, instance_writer: false
126
- ActiveRecord::Base.globalize_serialized_attributes = {}
103
+ ActiveSupport.on_load(:active_record) do
104
+ ActiveRecord::Base.class_attribute :globalize_serialized_attributes, instance_writer: false
105
+ ActiveRecord::Base.globalize_serialized_attributes = {}
127
106
 
128
- ActiveRecord::Base.extend(Globalize::ActiveRecord::ActMacro)
107
+ ActiveRecord::Base.extend(Globalize::ActiveRecord::ActMacro)
108
+ end
@@ -0,0 +1,28 @@
1
+ module Globalize
2
+ module AttributeMethods
3
+ module Serialization
4
+ def serialize(attr_name, class_name_or_coder = nil, **options)
5
+ self.globalize_serialized_attributes = globalize_serialized_attributes.dup
6
+
7
+ if class_name_or_coder.nil?
8
+ self.globalize_serialized_attributes[attr_name] = options
9
+
10
+ super(attr_name, **options)
11
+ elsif class_name_or_coder.is_a?(Hash)
12
+ self.globalize_serialized_attributes[attr_name] = class_name_or_coder
13
+
14
+ # https://github.com/rails/rails/blob/7-2-stable/activerecord/lib/active_record/attribute_methods/serialization.rb#L183
15
+ super(attr_name, **class_name_or_coder)
16
+ else
17
+ self.globalize_serialized_attributes[attr_name] = [class_name_or_coder, options]
18
+
19
+ # this is only needed for ACTIVE_RECORD_71. class_name_or_coder will be removed with Rails 7.2
20
+ # https://github.com/rails/rails/blob/7-1-stable/activerecord/lib/active_record/attribute_methods/serialization.rb#L183
21
+ super(attr_name, class_name_or_coder, **options)
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
27
+
28
+ ActiveRecord::AttributeMethods::Serialization::ClassMethods.send(:prepend, Globalize::AttributeMethods::Serialization)
@@ -0,0 +1,15 @@
1
+ module Globalize
2
+ module AttributeMethods
3
+ module Serialization
4
+ def serialize(attr_name, **options)
5
+ self.globalize_serialized_attributes = globalize_serialized_attributes.dup
6
+ self.globalize_serialized_attributes[attr_name] = options
7
+
8
+ # https://github.com/rails/rails/blob/7-2-stable/activerecord/lib/active_record/attribute_methods/serialization.rb#L183
9
+ super(attr_name, **options)
10
+ end
11
+ end
12
+ end
13
+ end
14
+
15
+ ActiveRecord::AttributeMethods::Serialization::ClassMethods.send(:prepend, Globalize::AttributeMethods::Serialization)
@@ -1,19 +1,15 @@
1
- if ::ActiveRecord.version >= Gem::Version.new("5.0.0")
2
- module Globalize
3
- module Relation
4
- def where_values_hash(relation_table_name = table_name)
5
- return super unless respond_to?(:translations_table_name)
6
- super.merge(super(translations_table_name))
7
- end
1
+ module Globalize
2
+ module Relation
3
+ def where_values_hash(relation_table_name = table_name)
4
+ return super unless respond_to?(:translations_table_name)
5
+ super.merge(super(translations_table_name))
6
+ end
8
7
 
9
- if ::ActiveRecord.version >= Gem::Version.new("6.1.3")
10
- def scope_for_create
11
- return super unless respond_to?(:translations_table_name)
12
- super.merge(where_values_hash(translations_table_name))
13
- end
14
- end
8
+ def scope_for_create
9
+ return super unless respond_to?(:translations_table_name)
10
+ super.merge(where_values_hash(translations_table_name))
15
11
  end
16
12
  end
17
-
18
- ActiveRecord::Relation.prepend Globalize::Relation
19
13
  end
14
+
15
+ ActiveRecord::Relation.prepend Globalize::Relation
@@ -1,7 +1,7 @@
1
- if ::ActiveRecord.version < Gem::Version.new("5.1.0")
2
- require_relative 'rails4/serialization'
3
- elsif ::ActiveRecord.version < Gem::Version.new("6.1.0")
4
- require_relative 'rails5_1/serialization'
5
- else
1
+ if ::ActiveRecord.version < Gem::Version.new("7.1.0")
6
2
  require_relative 'rails6_1/serialization'
3
+ elsif ::ActiveRecord.version < Gem::Version.new("7.2.0")
4
+ require_relative 'rails7_1/serialization'
5
+ else
6
+ require_relative 'rails7_2/serialization'
7
7
  end
@@ -1,9 +1 @@
1
- if ::ActiveRecord.version < Gem::Version.new("5.0.0")
2
- require_relative 'rails4/uniqueness_validator'
3
- elsif ::ActiveRecord.version < Gem::Version.new("5.1.0")
4
- require_relative 'rails5/uniqueness_validator'
5
- elsif ::ActiveRecord.version < Gem::Version.new("6.1.0")
6
- require_relative 'rails5_1/uniqueness_validator'
7
- else
8
- require_relative 'rails6_1/uniqueness_validator'
9
- end
1
+ require_relative 'rails6_1/uniqueness_validator'
@@ -1,14 +1,12 @@
1
- if ::ActiveSupport.version >= Gem::Version.new("7.0.0")
2
- module Globalize
3
- module Inflections
4
- def instance_or_fallback(locale)
5
- I18n.respond_to?(:fallbacks) && I18n.fallbacks[locale].each do |k|
6
- return @__instance__[k] if @__instance__.key?(k)
7
- end
8
- instance(locale)
1
+ module Globalize
2
+ module Inflections
3
+ def instance_or_fallback(locale)
4
+ I18n.respond_to?(:fallbacks) && I18n.fallbacks[locale].each do |k|
5
+ return @__instance__[k] if @__instance__.key?(k)
9
6
  end
7
+ instance(locale)
10
8
  end
11
9
  end
12
-
13
- ActiveSupport::Inflector::Inflections.singleton_class.send :prepend, Globalize::Inflections
14
10
  end
11
+
12
+ ActiveSupport::Inflector::Inflections.singleton_class.send :prepend, Globalize::Inflections
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.1
4
+ version: 7.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Fuchs
@@ -11,77 +11,71 @@ authors:
11
11
  - Tomasz Stachewicz
12
12
  - Philip Arndt
13
13
  - Chris Salzberg
14
- autorequire:
14
+ autorequire:
15
15
  bindir: bin
16
- cert_chain:
17
- - |
18
- -----BEGIN CERTIFICATE-----
19
- MIIEMjCCApqgAwIBAgIBATANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhnZW1z
20
- L0RDPXAvREM9YXJuZHQvREM9aW8wHhcNMjEwNjIzMDkyNzU2WhcNMjIwNjIzMDky
21
- NzU2WjAjMSEwHwYDVQQDDBhnZW1zL0RDPXAvREM9YXJuZHQvREM9aW8wggGiMA0G
22
- CSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQD0CYnD37uLlJ3Urla2EnnUQ8S6s16k
23
- AGMpAzpmARo8YwSqtYMJVGyBzUeI7y93Fk9ncswhIFSH/hnh/Ouat/ki9flHlZ+w
24
- anv0M+9v3wCLyZSC5BQIWpoduFM/fuvLoDUJDWxL50RjwMS0qo2x2LvfQdHN8gn3
25
- JdSIV5WLJKIvlmIl9S3pw0JO5KRUGn1PcBO7C0S0SlbhVjRHtlao1ycWUULsX109
26
- hCh39MPGtnZpdCcxheh0TH/UA/jV0/du9/rQdoidkNHkaC24pPfBJ3nS+rAbWaHP
27
- WmP+0rjfk/XnGBu/HZpKvlnwQjP3QdK4UMtWl8zewqFMNcIiBRALQugnL/SfrP/4
28
- CSlha9LwkiE6ByeY4WGnNjNqpi5J3IzjEkZRAxG7u9gCB3FzTaBTyXZYI6jplYNw
29
- TcCJIBHuoPaa+m9brpjb3Uv94nfM97ZP+OmpGYCCAMq4TT7OOV+t8wJc0w8bb0FO
30
- ROhmVNTxrBaNcl6MkZn88EMRCsGgoWklOG0CAwEAAaNxMG8wCQYDVR0TBAIwADAL
31
- BgNVHQ8EBAMCBLAwHQYDVR0OBBYEFGu7pbmeILyHnBmannuaNRfdN8MsMBoGA1Ud
32
- EQQTMBGBD2dlbXNAcC5hcm5kdC5pbzAaBgNVHRIEEzARgQ9nZW1zQHAuYXJuZHQu
33
- aW8wDQYJKoZIhvcNAQELBQADggGBANlxc4uAnkPC3zbztG7uZfBfn4HSuvv655Pa
34
- UaYZ6hNETFrqg78mGs3PkFe2Ru7cVWwckbmH46aq50QoNnx4ClxT03vr03n76Jg1
35
- 8WWHkf0+rcINFlbtIFcmcFrois5Ow3n7pH+xstDtzoWcbh41WwuZStNhrIYsnjAK
36
- /ovz8D5JlboxceOpVLB/0NiqNEWltK+EMQHmX25Sqf/r5o5rAL9zwEKPFp1Y5X+z
37
- t2jBjYt2ymr1eMWxux6e+N2uKZL4MblHawxvKlI8UHsIiV9xrc4BwlwlbitcvNIL
38
- ZykdSlpTJd0Guy92iYjCJMC09tMRUNxiVBwD3jRGSeW9YAPIZGXIcVlm6srIRDjJ
39
- o8wB6oOvHAkRXnntOo/4bBDH+ehmgvhh/O/mI+au6C0M430fv+ooH0w08LEXLx1k
40
- e17ZNASZffbQRP09MH2GZ2AOlkildTX6looWRforZEZi+qamognrozd3MI5QHi1W
41
- UAZUzHLrrFu7gnkFvLVpxOUf4ItOkA==
42
- -----END CERTIFICATE-----
43
- date: 2022-05-24 00:00:00.000000000 Z
16
+ cert_chain: []
17
+ date: 2024-12-19 00:00:00.000000000 Z
44
18
  dependencies:
19
+ - !ruby/object:Gem::Dependency
20
+ name: activesupport
21
+ requirement: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '7.0'
26
+ - - "<"
27
+ - !ruby/object:Gem::Version
28
+ version: '8.1'
29
+ type: :runtime
30
+ prerelease: false
31
+ version_requirements: !ruby/object:Gem::Requirement
32
+ requirements:
33
+ - - ">="
34
+ - !ruby/object:Gem::Version
35
+ version: '7.0'
36
+ - - "<"
37
+ - !ruby/object:Gem::Version
38
+ version: '8.1'
45
39
  - !ruby/object:Gem::Dependency
46
40
  name: activerecord
47
41
  requirement: !ruby/object:Gem::Requirement
48
42
  requirements:
49
43
  - - ">="
50
44
  - !ruby/object:Gem::Version
51
- version: '4.2'
45
+ version: '7.0'
52
46
  - - "<"
53
47
  - !ruby/object:Gem::Version
54
- version: '7.1'
48
+ version: '8.1'
55
49
  type: :runtime
56
50
  prerelease: false
57
51
  version_requirements: !ruby/object:Gem::Requirement
58
52
  requirements:
59
53
  - - ">="
60
54
  - !ruby/object:Gem::Version
61
- version: '4.2'
55
+ version: '7.0'
62
56
  - - "<"
63
57
  - !ruby/object:Gem::Version
64
- version: '7.1'
58
+ version: '8.1'
65
59
  - !ruby/object:Gem::Dependency
66
60
  name: activemodel
67
61
  requirement: !ruby/object:Gem::Requirement
68
62
  requirements:
69
63
  - - ">="
70
64
  - !ruby/object:Gem::Version
71
- version: '4.2'
65
+ version: '7.0'
72
66
  - - "<"
73
67
  - !ruby/object:Gem::Version
74
- version: '7.1'
68
+ version: '8.1'
75
69
  type: :runtime
76
70
  prerelease: false
77
71
  version_requirements: !ruby/object:Gem::Requirement
78
72
  requirements:
79
73
  - - ">="
80
74
  - !ruby/object:Gem::Version
81
- version: '4.2'
75
+ version: '7.0'
82
76
  - - "<"
83
77
  - !ruby/object:Gem::Version
84
- version: '7.1'
78
+ version: '8.1'
85
79
  - !ruby/object:Gem::Dependency
86
80
  name: request_store
87
81
  requirement: !ruby/object:Gem::Requirement
@@ -222,9 +216,6 @@ files:
222
216
  - LICENSE
223
217
  - README.md
224
218
  - Rakefile
225
- - docker-compose.yml
226
- - globalize.gemspec
227
- - issue_template.rb
228
219
  - lib/globalize.rb
229
220
  - lib/globalize/active_record.rb
230
221
  - lib/globalize/active_record/act_macro.rb
@@ -242,15 +233,10 @@ files:
242
233
  - lib/i18n/missing_translations_log_handler.rb
243
234
  - lib/i18n/missing_translations_raise_handler.rb
244
235
  - lib/patches/active_record/persistence.rb
245
- - lib/patches/active_record/query_method.rb
246
- - lib/patches/active_record/rails4/query_method.rb
247
- - lib/patches/active_record/rails4/serialization.rb
248
- - lib/patches/active_record/rails4/uniqueness_validator.rb
249
- - lib/patches/active_record/rails5/uniqueness_validator.rb
250
- - lib/patches/active_record/rails5_1/serialization.rb
251
- - lib/patches/active_record/rails5_1/uniqueness_validator.rb
252
236
  - lib/patches/active_record/rails6_1/serialization.rb
253
237
  - lib/patches/active_record/rails6_1/uniqueness_validator.rb
238
+ - lib/patches/active_record/rails7_1/serialization.rb
239
+ - lib/patches/active_record/rails7_2/serialization.rb
254
240
  - lib/patches/active_record/relation.rb
255
241
  - lib/patches/active_record/serialization.rb
256
242
  - lib/patches/active_record/uniqueness_validator.rb
@@ -260,7 +246,7 @@ homepage: http://github.com/globalize/globalize
260
246
  licenses:
261
247
  - MIT
262
248
  metadata: {}
263
- post_install_message:
249
+ post_install_message:
264
250
  rdoc_options: []
265
251
  require_paths:
266
252
  - lib
@@ -268,15 +254,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
268
254
  requirements:
269
255
  - - ">="
270
256
  - !ruby/object:Gem::Version
271
- version: 2.4.6
257
+ version: '3.0'
272
258
  required_rubygems_version: !ruby/object:Gem::Requirement
273
259
  requirements:
274
260
  - - ">="
275
261
  - !ruby/object:Gem::Version
276
262
  version: '0'
277
263
  requirements: []
278
- rubygems_version: 3.3.7
279
- signing_key:
264
+ rubygems_version: 3.5.22
265
+ signing_key:
280
266
  specification_version: 4
281
267
  summary: Rails I18n de-facto standard library for ActiveRecord model/data translation
282
268
  test_files: []
checksums.yaml.gz.sig DELETED
Binary file
data/docker-compose.yml DELETED
@@ -1,22 +0,0 @@
1
- version: '3.7'
2
- services:
3
- postgres:
4
- image: postgres:11
5
- volumes:
6
- - ./tmp/postgres:/var/lib/postgresql/data
7
- ports:
8
- - "5432:5432"
9
- environment:
10
- POSTGRES_USER: "postgres"
11
- POSTGRES_PASSWORD: ""
12
- mysql:
13
- image: mysql:8.0
14
- volumes:
15
- - ./tmp/mysql:/var/lib/mysql
16
- ports:
17
- - "3306:3306"
18
- environment:
19
- MYSQL_USER: "root"
20
- MYSQL_PASSWORD: ""
21
- MYSQL_ROOT_PASSWORD: ""
22
- MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
data/globalize.gemspec DELETED
@@ -1,37 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/globalize/version'
4
-
5
- Gem::Specification.new do |s|
6
- s.name = 'globalize'
7
- s.version = Globalize::Version
8
- s.authors = ['Sven Fuchs', 'Joshua Harvey', 'Clemens Kofler', 'John-Paul Bader', 'Tomasz Stachewicz', 'Philip Arndt', 'Chris Salzberg']
9
- s.email = 'nobody@globalize-rails.org'
10
- s.homepage = 'http://github.com/globalize/globalize'
11
- s.summary = 'Rails I18n de-facto standard library for ActiveRecord model/data translation'
12
- s.description = "#{s.summary}."
13
- s.license = "MIT"
14
-
15
- s.files = Dir['{lib/**/*,[A-Z]*}']
16
- s.platform = Gem::Platform::RUBY
17
- s.require_path = 'lib'
18
- s.required_ruby_version = '>= 2.4.6'
19
-
20
- s.add_dependency 'activerecord', '>= 4.2', '< 7.1'
21
- s.add_dependency 'activemodel', '>= 4.2', '< 7.1'
22
- s.add_dependency 'request_store', '~> 1.0'
23
-
24
- s.add_development_dependency 'appraisal'
25
- s.add_development_dependency 'database_cleaner'
26
- s.add_development_dependency 'm'
27
- s.add_development_dependency 'minitest'
28
- s.add_development_dependency 'minitest-reporters'
29
- s.add_development_dependency 'pry'
30
- s.add_development_dependency 'rake'
31
- s.add_development_dependency 'rdoc'
32
-
33
- s.cert_chain = [File.expand_path('certs/parndt.pem', __dir__)]
34
- if $PROGRAM_NAME =~ /gem\z/ && ARGV.include?('build') && ARGV.include?(__FILE__)
35
- s.signing_key = File.expand_path('~/.ssh/gem-private_key.pem')
36
- end
37
- end
data/issue_template.rb DELETED
@@ -1,38 +0,0 @@
1
- # Activate the gem you are reporting the issue against.
2
- gem 'activerecord', '4.2.0'
3
- gem 'globalize', '5.0.1'
4
- require 'active_record'
5
- require 'globalize'
6
- require 'minitest/autorun'
7
- require 'logger'
8
-
9
- # Ensure backward compatibility with Minitest 4
10
- Minitest::Test = MiniTest::Unit::TestCase unless defined?(Minitest::Test)
11
-
12
- # This connection will do for database-independent bug reports.
13
- ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
14
- ActiveRecord::Base.logger = Logger.new(STDOUT)
15
-
16
- ActiveRecord::Schema.define do
17
- create_table :posts, force: true do |t|
18
- end
19
-
20
- create_table :post_translations, force: true do |t|
21
- t.references :post
22
- t.string :title
23
- t.text :content
24
- t.string :locale
25
- end
26
- end
27
-
28
- class Post < ActiveRecord::Base
29
- translates :content, :title
30
- end
31
-
32
- class BugTest < Minitest::Test
33
- def test_association_stuff
34
- post = Post.create!(title: 'HI')
35
-
36
- assert_equal 'HI', post.title
37
- end
38
- end
@@ -1,3 +0,0 @@
1
- if ::ActiveRecord.version < Gem::Version.new("5.0.0")
2
- require_relative 'rails4/query_method'
3
- end