globalize 6.0.1 → 6.1.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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/Appraisals +5 -4
- data/Gemfile.lock +111 -0
- data/globalize.gemspec +2 -2
- data/lib/globalize/active_record/migration.rb +2 -0
- data/lib/globalize/version.rb +1 -1
- data/lib/globalize.rb +1 -0
- data/lib/patches/active_support/inflections.rb +14 -0
- data.tar.gz.sig +0 -0
- metadata +9 -7
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 70e3196446a295412903e65b76e6a1d834904abb732a7692232936fa782f4a9a
|
|
4
|
+
data.tar.gz: 672eddfec21d2d7205d36bbbe176f646f84511c51a5508056cea828d2d8f2751
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 90f9f98183c545e5f255dd57b48367f6e7b1bba0bde85962c7613e8957086e16757432b56f84acaea36dcbd222ca07d2b0188278bebea7d065ccdb80a052ff22
|
|
7
|
+
data.tar.gz: e6a718305ce3fd62835ceed0fefdadf4cb19b2e9499a7955acf19763f655b406b468e951f22e6d15edc147ec22906ec17d3792b66fd5bff8eef3ab17071907a3
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/Appraisals
CHANGED
|
@@ -6,6 +6,7 @@ RAILS_VERSIONS = %w[
|
|
|
6
6
|
5.2.5
|
|
7
7
|
6.0.3.6
|
|
8
8
|
6.1.3.1
|
|
9
|
+
7.0.0
|
|
9
10
|
]
|
|
10
11
|
|
|
11
12
|
RAILS_VERSIONS.each do |version|
|
|
@@ -13,12 +14,12 @@ RAILS_VERSIONS.each do |version|
|
|
|
13
14
|
gem 'activemodel', version
|
|
14
15
|
gem 'activerecord', version
|
|
15
16
|
|
|
16
|
-
if version =~ /^
|
|
17
|
-
gem 'sqlite3', '~> 1.
|
|
17
|
+
if version =~ /^4/
|
|
18
|
+
gem 'sqlite3', '~> 1.3.6', platforms: [:ruby, :rbx]
|
|
18
19
|
elsif version =~ /^5/
|
|
19
20
|
gem 'sqlite3', '~> 1.3', '>= 1.3.6', platforms: [:ruby, :rbx]
|
|
20
|
-
else
|
|
21
|
-
gem 'sqlite3', '~> 1.
|
|
21
|
+
else
|
|
22
|
+
gem 'sqlite3', '~> 1.4', platforms: [:ruby, :rbx]
|
|
22
23
|
end
|
|
23
24
|
|
|
24
25
|
if !ENV['CI'] || %w(postgres postgresql).include?(ENV['DB'])
|
data/Gemfile.lock
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
PATH
|
|
2
|
+
remote: .
|
|
3
|
+
specs:
|
|
4
|
+
globalize (6.0.1)
|
|
5
|
+
activemodel (>= 4.2, < 7.0)
|
|
6
|
+
activerecord (>= 4.2, < 7.0)
|
|
7
|
+
request_store (~> 1.0)
|
|
8
|
+
|
|
9
|
+
GEM
|
|
10
|
+
remote: https://rubygems.org/
|
|
11
|
+
specs:
|
|
12
|
+
activemodel (6.1.4.1)
|
|
13
|
+
activesupport (= 6.1.4.1)
|
|
14
|
+
activerecord (6.1.4.1)
|
|
15
|
+
activemodel (= 6.1.4.1)
|
|
16
|
+
activesupport (= 6.1.4.1)
|
|
17
|
+
activesupport (6.1.4.1)
|
|
18
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
19
|
+
i18n (>= 1.6, < 2)
|
|
20
|
+
minitest (>= 5.1)
|
|
21
|
+
tzinfo (~> 2.0)
|
|
22
|
+
zeitwerk (~> 2.3)
|
|
23
|
+
ansi (1.5.0)
|
|
24
|
+
appraisal (2.4.1)
|
|
25
|
+
bundler
|
|
26
|
+
rake
|
|
27
|
+
thor (>= 0.14.0)
|
|
28
|
+
ast (2.4.2)
|
|
29
|
+
builder (3.2.4)
|
|
30
|
+
coderay (1.1.3)
|
|
31
|
+
concurrent-ruby (1.1.9)
|
|
32
|
+
database_cleaner (2.0.1)
|
|
33
|
+
database_cleaner-active_record (~> 2.0.0)
|
|
34
|
+
database_cleaner-active_record (2.0.1)
|
|
35
|
+
activerecord (>= 5.a)
|
|
36
|
+
database_cleaner-core (~> 2.0.0)
|
|
37
|
+
database_cleaner-core (2.0.1)
|
|
38
|
+
i18n (1.8.10)
|
|
39
|
+
concurrent-ruby (~> 1.0)
|
|
40
|
+
m (1.6.0)
|
|
41
|
+
method_source (>= 0.6.7)
|
|
42
|
+
rake (>= 0.9.2.2)
|
|
43
|
+
method_source (1.0.0)
|
|
44
|
+
minitest (5.14.4)
|
|
45
|
+
minitest-reporters (1.4.3)
|
|
46
|
+
ansi
|
|
47
|
+
builder
|
|
48
|
+
minitest (>= 5.0)
|
|
49
|
+
ruby-progressbar
|
|
50
|
+
mysql2 (0.5.3)
|
|
51
|
+
parallel (1.20.1)
|
|
52
|
+
parser (3.0.2.0)
|
|
53
|
+
ast (~> 2.4.1)
|
|
54
|
+
pg (1.2.3)
|
|
55
|
+
pry (0.14.1)
|
|
56
|
+
coderay (~> 1.1)
|
|
57
|
+
method_source (~> 1.0)
|
|
58
|
+
rack (2.2.3)
|
|
59
|
+
rainbow (3.0.0)
|
|
60
|
+
rake (13.0.6)
|
|
61
|
+
rdoc (6.3.2)
|
|
62
|
+
regexp_parser (2.1.1)
|
|
63
|
+
request_store (1.5.0)
|
|
64
|
+
rack (>= 1.4)
|
|
65
|
+
rexml (3.2.5)
|
|
66
|
+
rubocop (1.20.0)
|
|
67
|
+
parallel (~> 1.10)
|
|
68
|
+
parser (>= 3.0.0.0)
|
|
69
|
+
rainbow (>= 2.2.2, < 4.0)
|
|
70
|
+
regexp_parser (>= 1.8, < 3.0)
|
|
71
|
+
rexml
|
|
72
|
+
rubocop-ast (>= 1.9.1, < 2.0)
|
|
73
|
+
ruby-progressbar (~> 1.7)
|
|
74
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
|
75
|
+
rubocop-ast (1.11.0)
|
|
76
|
+
parser (>= 3.0.1.1)
|
|
77
|
+
rubocop-performance (1.11.5)
|
|
78
|
+
rubocop (>= 1.7.0, < 2.0)
|
|
79
|
+
rubocop-ast (>= 0.4.0)
|
|
80
|
+
ruby-progressbar (1.11.0)
|
|
81
|
+
sqlite3 (1.4.2)
|
|
82
|
+
standard (1.3.0)
|
|
83
|
+
rubocop (= 1.20.0)
|
|
84
|
+
rubocop-performance (= 1.11.5)
|
|
85
|
+
thor (1.1.0)
|
|
86
|
+
tzinfo (2.0.4)
|
|
87
|
+
concurrent-ruby (~> 1.0)
|
|
88
|
+
unicode-display_width (2.0.0)
|
|
89
|
+
zeitwerk (2.4.2)
|
|
90
|
+
|
|
91
|
+
PLATFORMS
|
|
92
|
+
arm64-darwin-20
|
|
93
|
+
arm64-darwin-21
|
|
94
|
+
|
|
95
|
+
DEPENDENCIES
|
|
96
|
+
appraisal
|
|
97
|
+
database_cleaner
|
|
98
|
+
globalize!
|
|
99
|
+
m
|
|
100
|
+
minitest
|
|
101
|
+
minitest-reporters
|
|
102
|
+
mysql2
|
|
103
|
+
pg
|
|
104
|
+
pry
|
|
105
|
+
rake
|
|
106
|
+
rdoc
|
|
107
|
+
sqlite3
|
|
108
|
+
standard
|
|
109
|
+
|
|
110
|
+
BUNDLED WITH
|
|
111
|
+
2.2.28
|
data/globalize.gemspec
CHANGED
|
@@ -17,8 +17,8 @@ Gem::Specification.new do |s|
|
|
|
17
17
|
s.require_path = 'lib'
|
|
18
18
|
s.required_ruby_version = '>= 2.4.6'
|
|
19
19
|
|
|
20
|
-
s.add_dependency 'activerecord', '>= 4.2', '< 7.
|
|
21
|
-
s.add_dependency 'activemodel', '>= 4.2', '< 7.
|
|
20
|
+
s.add_dependency 'activerecord', '>= 4.2', '< 7.1'
|
|
21
|
+
s.add_dependency 'activemodel', '>= 4.2', '< 7.1'
|
|
22
22
|
s.add_dependency 'request_store', '~> 1.0'
|
|
23
23
|
|
|
24
24
|
s.add_development_dependency 'appraisal'
|
|
@@ -169,6 +169,8 @@ module Globalize
|
|
|
169
169
|
# Create a hash containing the translated column names and their values.
|
|
170
170
|
translated_attribute_names.inject(fields_to_update={}) do |f, name|
|
|
171
171
|
f.update({name.to_sym => translated_record[name.to_s]})
|
|
172
|
+
# Remove attributes that will no longer be translated
|
|
173
|
+
translated_attribute_names.delete(name)
|
|
172
174
|
end
|
|
173
175
|
|
|
174
176
|
# Now, update the actual model's record with the hash.
|
data/lib/globalize/version.rb
CHANGED
data/lib/globalize.rb
CHANGED
|
@@ -6,6 +6,7 @@ require 'patches/active_record/relation'
|
|
|
6
6
|
require 'patches/active_record/serialization'
|
|
7
7
|
require 'patches/active_record/uniqueness_validator'
|
|
8
8
|
require 'patches/active_record/persistence'
|
|
9
|
+
require 'patches/active_support/inflections'
|
|
9
10
|
|
|
10
11
|
module Globalize
|
|
11
12
|
autoload :ActiveRecord, 'globalize/active_record'
|
|
@@ -0,0 +1,14 @@
|
|
|
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)
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
ActiveSupport::Inflector::Inflections.singleton_class.send :prepend, Globalize::Inflections
|
|
14
|
+
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.0
|
|
4
|
+
version: 6.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sven Fuchs
|
|
@@ -40,7 +40,7 @@ cert_chain:
|
|
|
40
40
|
e17ZNASZffbQRP09MH2GZ2AOlkildTX6looWRforZEZi+qamognrozd3MI5QHi1W
|
|
41
41
|
UAZUzHLrrFu7gnkFvLVpxOUf4ItOkA==
|
|
42
42
|
-----END CERTIFICATE-----
|
|
43
|
-
date:
|
|
43
|
+
date: 2022-02-25 00:00:00.000000000 Z
|
|
44
44
|
dependencies:
|
|
45
45
|
- !ruby/object:Gem::Dependency
|
|
46
46
|
name: activerecord
|
|
@@ -51,7 +51,7 @@ dependencies:
|
|
|
51
51
|
version: '4.2'
|
|
52
52
|
- - "<"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '7.
|
|
54
|
+
version: '7.1'
|
|
55
55
|
type: :runtime
|
|
56
56
|
prerelease: false
|
|
57
57
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -61,7 +61,7 @@ dependencies:
|
|
|
61
61
|
version: '4.2'
|
|
62
62
|
- - "<"
|
|
63
63
|
- !ruby/object:Gem::Version
|
|
64
|
-
version: '7.
|
|
64
|
+
version: '7.1'
|
|
65
65
|
- !ruby/object:Gem::Dependency
|
|
66
66
|
name: activemodel
|
|
67
67
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -71,7 +71,7 @@ dependencies:
|
|
|
71
71
|
version: '4.2'
|
|
72
72
|
- - "<"
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: '7.
|
|
74
|
+
version: '7.1'
|
|
75
75
|
type: :runtime
|
|
76
76
|
prerelease: false
|
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -81,7 +81,7 @@ dependencies:
|
|
|
81
81
|
version: '4.2'
|
|
82
82
|
- - "<"
|
|
83
83
|
- !ruby/object:Gem::Version
|
|
84
|
-
version: '7.
|
|
84
|
+
version: '7.1'
|
|
85
85
|
- !ruby/object:Gem::Dependency
|
|
86
86
|
name: request_store
|
|
87
87
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -218,6 +218,7 @@ files:
|
|
|
218
218
|
- CHANGELOG.md
|
|
219
219
|
- CONTRIBUTING.md
|
|
220
220
|
- Gemfile
|
|
221
|
+
- Gemfile.lock
|
|
221
222
|
- LICENSE
|
|
222
223
|
- README.md
|
|
223
224
|
- Rakefile
|
|
@@ -253,6 +254,7 @@ files:
|
|
|
253
254
|
- lib/patches/active_record/serialization.rb
|
|
254
255
|
- lib/patches/active_record/uniqueness_validator.rb
|
|
255
256
|
- lib/patches/active_record/xml_attribute_serializer.rb
|
|
257
|
+
- lib/patches/active_support/inflections.rb
|
|
256
258
|
homepage: http://github.com/globalize/globalize
|
|
257
259
|
licenses:
|
|
258
260
|
- MIT
|
|
@@ -272,7 +274,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
272
274
|
- !ruby/object:Gem::Version
|
|
273
275
|
version: '0'
|
|
274
276
|
requirements: []
|
|
275
|
-
rubygems_version: 3.
|
|
277
|
+
rubygems_version: 3.2.32
|
|
276
278
|
signing_key:
|
|
277
279
|
specification_version: 4
|
|
278
280
|
summary: Rails I18n de-facto standard library for ActiveRecord model/data translation
|
metadata.gz.sig
CHANGED
|
Binary file
|