globalize 6.3.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Appraisals +2 -13
- data/CHANGELOG.md +8 -1
- data/CONTRIBUTING.md +2 -4
- data/Gemfile +8 -0
- data/Gemfile.lock +45 -43
- data/README.md +37 -47
- data/Rakefile +22 -17
- data/lib/globalize/active_record/act_macro.rb +20 -22
- data/lib/globalize/active_record/adapter_dirty.rb +2 -11
- data/lib/globalize/active_record/class_methods.rb +7 -8
- data/lib/globalize/active_record/instance_methods.rb +21 -56
- data/lib/globalize/active_record/migration.rb +7 -21
- data/lib/globalize/active_record/translated_attributes_query.rb +0 -17
- data/lib/globalize/version.rb +1 -1
- data/lib/globalize.rb +14 -34
- data/lib/patches/active_record/rails7_1/serialization.rb +28 -0
- data/lib/patches/active_record/rails7_2/serialization.rb +15 -0
- data/lib/patches/active_record/relation.rb +11 -15
- data/lib/patches/active_record/serialization.rb +5 -5
- data/lib/patches/active_record/uniqueness_validator.rb +1 -9
- data/lib/patches/active_support/inflections.rb +8 -10
- metadata +38 -54
- checksums.yaml.gz.sig +0 -0
- data/docker-compose.yml +0 -22
- data/globalize.gemspec +0 -37
- data/issue_template.rb +0 -38
- data/lib/patches/active_record/query_method.rb +0 -3
- data/lib/patches/active_record/rails4/query_method.rb +0 -35
- data/lib/patches/active_record/rails4/serialization.rb +0 -22
- data/lib/patches/active_record/rails4/uniqueness_validator.rb +0 -42
- data/lib/patches/active_record/rails5/uniqueness_validator.rb +0 -47
- data/lib/patches/active_record/rails5_1/serialization.rb +0 -22
- data/lib/patches/active_record/rails5_1/uniqueness_validator.rb +0 -45
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -3
@@ -17,24 +17,9 @@ module Globalize
|
|
17
17
|
with_given_locale(attributes) { super(attributes.except("locale"), *options) }
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
-
|
162
|
-
|
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
|
-
|
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
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
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
|
-
|
218
|
-
|
219
|
-
|
220
|
-
end
|
185
|
+
def changed_attributes
|
186
|
+
super.merge(globalize.changed_attributes(::Globalize.locale))
|
187
|
+
end
|
221
188
|
|
222
|
-
|
223
|
-
|
224
|
-
|
189
|
+
def changes
|
190
|
+
super.merge(globalize.changes(::Globalize.locale))
|
191
|
+
end
|
225
192
|
|
226
|
-
|
227
|
-
|
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
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
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
|
data/lib/globalize/version.rb
CHANGED
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
|
-
|
16
|
-
|
17
|
-
|
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
|
72
|
-
|
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
|
84
|
-
::ActiveRecord.version >=
|
69
|
+
def rails_7_1?
|
70
|
+
::ActiveRecord.version >= ACTIVE_RECORD_71
|
85
71
|
end
|
86
72
|
|
87
|
-
def
|
88
|
-
::ActiveRecord.version >=
|
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
|
-
|
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
|
-
|
2
|
-
module
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
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
|
-
|
10
|
-
|
11
|
-
|
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("
|
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
|
-
|
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
|
-
|
2
|
-
module
|
3
|
-
|
4
|
-
|
5
|
-
|
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:
|
4
|
+
version: 7.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Fuchs
|
@@ -11,79 +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
|
-
MIIEljCCAv6gAwIBAgIBATANBgkqhkiG9w0BAQsFADBRMREwDwYDVQQDDAhydWJ5
|
20
|
-
Z2VtczERMA8GCgmSJomT8ixkARkWAXAxFTATBgoJkiaJk/IsZAEZFgVhcm5kdDES
|
21
|
-
MBAGCgmSJomT8ixkARkWAmlvMB4XDTIyMTExNTIyMjQzMFoXDTIzMTExNTIyMjQz
|
22
|
-
MFowUTERMA8GA1UEAwwIcnVieWdlbXMxETAPBgoJkiaJk/IsZAEZFgFwMRUwEwYK
|
23
|
-
CZImiZPyLGQBGRYFYXJuZHQxEjAQBgoJkiaJk/IsZAEZFgJpbzCCAaIwDQYJKoZI
|
24
|
-
hvcNAQEBBQADggGPADCCAYoCggGBAMPq2bIEO+BmmBeuidSySK7xlL/LWBHzyDxw
|
25
|
-
EMgWsHqJMDZYCZI4WoWbSTSSLrp5zPXLWN0hB23u3dxFp4RVygTTZkc8k05mteab
|
26
|
-
fdREGgdcP+mY8/ASQSvb1VW6IM51Srgjy1SK0S5Qf3HAiQafFvRsxRkY0SWyth24
|
27
|
-
ne/7HG667vHQ1+t0VFl8twupJE9S8p2zgX3eZBl2yRNm/kE5reUsOLvmS58Iri/X
|
28
|
-
9tnz0SGkzrKkim9OIByq7XkFLL3oaIyfbBVgOWilM5pvxj/xNuRH7EIM6aE3q0UZ
|
29
|
-
xo7o9u9Iz2zApDEjejByPjxWAhLuP3v3bJyinRFE1rO47lEM/s6KM/6YooxvgYIN
|
30
|
-
miYYFRtTj9nmKEMv6+h1mZ1/ZwqStTTRh/T90T65dcgsoqRd0JNvpNRjFrYH5cuj
|
31
|
-
QZWMl/FE6AADm0GXa34ZiTQx3Wx2ctqJLFak8+imPwes90nCpiYmgaZpwBI+shjU
|
32
|
-
AddbPDNq+EoxPMWTh0Er3w76fywOWQIDAQABo3kwdzAJBgNVHRMEAjAAMAsGA1Ud
|
33
|
-
DwQEAwIEsDAdBgNVHQ4EFgQUxRJaTQZmtkN8FKUWVHKc2riND18wHgYDVR0RBBcw
|
34
|
-
FYETcnVieWdlbXNAcC5hcm5kdC5pbzAeBgNVHRIEFzAVgRNydWJ5Z2Vtc0BwLmFy
|
35
|
-
bmR0LmlvMA0GCSqGSIb3DQEBCwUAA4IBgQBSRGMkZ2dvJ0LSjFz+rIt3G3AZMbKD
|
36
|
-
tjaaQRuC9rOkrl3Rml6h9j7cHYiM0wkTjXneFNySc8jWmM/jKnxiiUfUK9r1XL4n
|
37
|
-
71tz39+MD2lIpLVVEQ69MIoUseppNUTCg0mNghSDYNwISMD/hoWwbJudBi56DbhE
|
38
|
-
xkulLbw8qtcEE+iilIKibe+eJF4platKScsOA7d1AuilR1/S245UzeqwwyI52/xK
|
39
|
-
dfoP928X9Tb/48+83lWUgAgCQOd6WdfCpgQ5H6R90lc8L7OfuDR/vgcmSOTsNVgG
|
40
|
-
1TC3b2FISS0p0qfZsiS7BXh+ARoBKLXsV1a7WR36X0dUpajvk+zzBGrFCdbW43Gx
|
41
|
-
wmJzIksYnf9Ktg8Ux+FLcRBGw4qEIyWvqmS0obB1Hke68rTg0uNTFcKXsNw33XF5
|
42
|
-
fw1cbj95g7OPe0feGK8+afXh/L38vx/hIIOGlUEZ+HaWL2Dki/7vRGvda8dfOpG5
|
43
|
-
bJfaoyKbVsrK+gGKFJv860zsO8lg6BGLsUw=
|
44
|
-
-----END CERTIFICATE-----
|
45
|
-
date: 2023-10-20 00:00:00.000000000 Z
|
16
|
+
cert_chain: []
|
17
|
+
date: 2024-12-19 00:00:00.000000000 Z
|
46
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'
|
47
39
|
- !ruby/object:Gem::Dependency
|
48
40
|
name: activerecord
|
49
41
|
requirement: !ruby/object:Gem::Requirement
|
50
42
|
requirements:
|
51
43
|
- - ">="
|
52
44
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
45
|
+
version: '7.0'
|
54
46
|
- - "<"
|
55
47
|
- !ruby/object:Gem::Version
|
56
|
-
version: '
|
48
|
+
version: '8.1'
|
57
49
|
type: :runtime
|
58
50
|
prerelease: false
|
59
51
|
version_requirements: !ruby/object:Gem::Requirement
|
60
52
|
requirements:
|
61
53
|
- - ">="
|
62
54
|
- !ruby/object:Gem::Version
|
63
|
-
version: '
|
55
|
+
version: '7.0'
|
64
56
|
- - "<"
|
65
57
|
- !ruby/object:Gem::Version
|
66
|
-
version: '
|
58
|
+
version: '8.1'
|
67
59
|
- !ruby/object:Gem::Dependency
|
68
60
|
name: activemodel
|
69
61
|
requirement: !ruby/object:Gem::Requirement
|
70
62
|
requirements:
|
71
63
|
- - ">="
|
72
64
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
65
|
+
version: '7.0'
|
74
66
|
- - "<"
|
75
67
|
- !ruby/object:Gem::Version
|
76
|
-
version: '
|
68
|
+
version: '8.1'
|
77
69
|
type: :runtime
|
78
70
|
prerelease: false
|
79
71
|
version_requirements: !ruby/object:Gem::Requirement
|
80
72
|
requirements:
|
81
73
|
- - ">="
|
82
74
|
- !ruby/object:Gem::Version
|
83
|
-
version: '
|
75
|
+
version: '7.0'
|
84
76
|
- - "<"
|
85
77
|
- !ruby/object:Gem::Version
|
86
|
-
version: '
|
78
|
+
version: '8.1'
|
87
79
|
- !ruby/object:Gem::Dependency
|
88
80
|
name: request_store
|
89
81
|
requirement: !ruby/object:Gem::Requirement
|
@@ -224,9 +216,6 @@ files:
|
|
224
216
|
- LICENSE
|
225
217
|
- README.md
|
226
218
|
- Rakefile
|
227
|
-
- docker-compose.yml
|
228
|
-
- globalize.gemspec
|
229
|
-
- issue_template.rb
|
230
219
|
- lib/globalize.rb
|
231
220
|
- lib/globalize/active_record.rb
|
232
221
|
- lib/globalize/active_record/act_macro.rb
|
@@ -244,15 +233,10 @@ files:
|
|
244
233
|
- lib/i18n/missing_translations_log_handler.rb
|
245
234
|
- lib/i18n/missing_translations_raise_handler.rb
|
246
235
|
- lib/patches/active_record/persistence.rb
|
247
|
-
- lib/patches/active_record/query_method.rb
|
248
|
-
- lib/patches/active_record/rails4/query_method.rb
|
249
|
-
- lib/patches/active_record/rails4/serialization.rb
|
250
|
-
- lib/patches/active_record/rails4/uniqueness_validator.rb
|
251
|
-
- lib/patches/active_record/rails5/uniqueness_validator.rb
|
252
|
-
- lib/patches/active_record/rails5_1/serialization.rb
|
253
|
-
- lib/patches/active_record/rails5_1/uniqueness_validator.rb
|
254
236
|
- lib/patches/active_record/rails6_1/serialization.rb
|
255
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
|
256
240
|
- lib/patches/active_record/relation.rb
|
257
241
|
- lib/patches/active_record/serialization.rb
|
258
242
|
- lib/patches/active_record/uniqueness_validator.rb
|
@@ -262,7 +246,7 @@ homepage: http://github.com/globalize/globalize
|
|
262
246
|
licenses:
|
263
247
|
- MIT
|
264
248
|
metadata: {}
|
265
|
-
post_install_message:
|
249
|
+
post_install_message:
|
266
250
|
rdoc_options: []
|
267
251
|
require_paths:
|
268
252
|
- lib
|
@@ -270,15 +254,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
270
254
|
requirements:
|
271
255
|
- - ">="
|
272
256
|
- !ruby/object:Gem::Version
|
273
|
-
version:
|
257
|
+
version: '3.0'
|
274
258
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
275
259
|
requirements:
|
276
260
|
- - ">="
|
277
261
|
- !ruby/object:Gem::Version
|
278
262
|
version: '0'
|
279
263
|
requirements: []
|
280
|
-
rubygems_version: 3.
|
281
|
-
signing_key:
|
264
|
+
rubygems_version: 3.5.22
|
265
|
+
signing_key:
|
282
266
|
specification_version: 4
|
283
267
|
summary: Rails I18n de-facto standard library for ActiveRecord model/data translation
|
284
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.2'
|
21
|
-
s.add_dependency 'activemodel', '>= 4.2', '< 7.2'
|
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
|