globalize 5.2.0 → 5.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +23 -33
- data/README.md +3 -0
- data/lib/globalize/active_record/adapter_dirty.rb +3 -1
- data/lib/globalize/active_record/class_methods.rb +1 -1
- data/lib/globalize/active_record/migration.rb +5 -1
- data/lib/globalize/version.rb +3 -1
- metadata +8 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1a9c4607049c3148c7776b5042d30484e64a37a5ae8db707063a12feaaad58cb
|
4
|
+
data.tar.gz: beb3e48916b787e972626b9372dd72124ef332481db3ad2d62d156091546bb21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66ba0dce842a6fb7b12ff23faaa2fcd834b586e94bc4c2f7e7bcddc5be97f48c697a08fc861b961dbc97172aa79939a08aa5ea567ea0a37fc04e4c5cfee330b0
|
7
|
+
data.tar.gz: 738d84f3776f6529bb13b67012d8bc780a4ce7eff465c193738f715c92e60095f0c90d70be3a9c1f9311467533009214d41f628c4b9b243f2fa514457c240d5a
|
data/Gemfile.lock
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
globalize (5.
|
5
|
-
activemodel (>= 4.2, <
|
6
|
-
activerecord (>= 4.2, <
|
4
|
+
globalize (5.3.0)
|
5
|
+
activemodel (>= 4.2, < 6.1)
|
6
|
+
activerecord (>= 4.2, < 6.1)
|
7
7
|
request_store (~> 1.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activemodel (5.2.
|
13
|
-
activesupport (= 5.2.
|
14
|
-
activerecord (5.2.
|
15
|
-
activemodel (= 5.2.
|
16
|
-
activesupport (= 5.2.
|
12
|
+
activemodel (5.2.3)
|
13
|
+
activesupport (= 5.2.3)
|
14
|
+
activerecord (5.2.3)
|
15
|
+
activemodel (= 5.2.3)
|
16
|
+
activesupport (= 5.2.3)
|
17
17
|
arel (>= 9.0)
|
18
|
-
activesupport (5.2.
|
18
|
+
activesupport (5.2.3)
|
19
19
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
20
20
|
i18n (>= 0.7, < 2)
|
21
21
|
minitest (~> 5.1)
|
@@ -28,46 +28,36 @@ GEM
|
|
28
28
|
arel (9.0.0)
|
29
29
|
builder (3.2.3)
|
30
30
|
coderay (1.1.2)
|
31
|
-
concurrent-ruby (1.
|
32
|
-
|
33
|
-
|
34
|
-
ffi (1.9.18-java)
|
35
|
-
i18n (1.1.1)
|
31
|
+
concurrent-ruby (1.1.5)
|
32
|
+
database_cleaner (1.7.0)
|
33
|
+
i18n (1.6.0)
|
36
34
|
concurrent-ruby (~> 1.0)
|
37
35
|
m (1.5.1)
|
38
36
|
method_source (>= 0.6.7)
|
39
37
|
rake (>= 0.9.2.2)
|
40
|
-
method_source (0.9.
|
41
|
-
minitest (5.11.
|
42
|
-
minitest-reporters (1.
|
38
|
+
method_source (0.9.2)
|
39
|
+
minitest (5.11.3)
|
40
|
+
minitest-reporters (1.3.6)
|
43
41
|
ansi
|
44
42
|
builder
|
45
43
|
minitest (>= 5.0)
|
46
44
|
ruby-progressbar
|
47
|
-
pry (0.
|
45
|
+
pry (0.12.2)
|
48
46
|
coderay (~> 1.1.0)
|
49
47
|
method_source (~> 0.9.0)
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
spoon (~> 0.0)
|
54
|
-
rack (2.0.5)
|
55
|
-
rake (12.3.0)
|
56
|
-
rdoc (6.0.1)
|
48
|
+
rack (2.0.7)
|
49
|
+
rake (12.3.2)
|
50
|
+
rdoc (6.1.1)
|
57
51
|
request_store (1.4.1)
|
58
52
|
rack (>= 1.4)
|
59
|
-
ruby-progressbar (1.
|
60
|
-
|
61
|
-
|
62
|
-
sqlite3 (1.3.13)
|
63
|
-
thor (0.20.0)
|
53
|
+
ruby-progressbar (1.10.0)
|
54
|
+
sqlite3 (1.4.1)
|
55
|
+
thor (0.20.3)
|
64
56
|
thread_safe (0.3.6)
|
65
|
-
thread_safe (0.3.6-java)
|
66
57
|
tzinfo (1.2.5)
|
67
58
|
thread_safe (~> 0.1)
|
68
59
|
|
69
60
|
PLATFORMS
|
70
|
-
java
|
71
61
|
ruby
|
72
62
|
|
73
63
|
DEPENDENCIES
|
@@ -83,4 +73,4 @@ DEPENDENCIES
|
|
83
73
|
sqlite3
|
84
74
|
|
85
75
|
BUNDLED WITH
|
86
|
-
|
76
|
+
2.0.1
|
data/README.md
CHANGED
@@ -271,6 +271,9 @@ You can enable them by adding the next line to `config/application.rb` (or only
|
|
271
271
|
`config/environments/production.rb` if you only want them in production)
|
272
272
|
|
273
273
|
```ruby
|
274
|
+
# For version 1.1.0 and above of the `i18n` gem:
|
275
|
+
config.i18n.fallbacks = [I18n.default_locale]
|
276
|
+
# Below version 1.1.0 of the `i18n` gem:
|
274
277
|
config.i18n.fallbacks = true
|
275
278
|
```
|
276
279
|
|
@@ -42,7 +42,9 @@ module Globalize
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def _reset_attribute name
|
45
|
-
|
45
|
+
original_value = record.changed_attributes[name]
|
46
|
+
record.send(:clear_attribute_changes, [name])
|
47
|
+
record.send("#{name}=", original_value)
|
46
48
|
record.send(:clear_attribute_changes, [name])
|
47
49
|
end
|
48
50
|
|
@@ -98,7 +98,6 @@ module Globalize
|
|
98
98
|
end
|
99
99
|
|
100
100
|
def define_translated_attr_accessor(name)
|
101
|
-
attribute(name, ::ActiveRecord::Type::Value.new)
|
102
101
|
define_translated_attr_reader(name)
|
103
102
|
define_translated_attr_writer(name)
|
104
103
|
end
|
@@ -121,6 +120,7 @@ module Globalize
|
|
121
120
|
end
|
122
121
|
|
123
122
|
def define_translations_accessor(name)
|
123
|
+
attribute(name, ::ActiveRecord::Type::Value.new) if ::ActiveRecord::VERSION::STRING >= "5.0"
|
124
124
|
define_translations_reader(name)
|
125
125
|
define_translations_writer(name)
|
126
126
|
end
|
@@ -78,7 +78,11 @@ module Globalize
|
|
78
78
|
|
79
79
|
def create_translation_table
|
80
80
|
connection.create_table(translations_table_name) do |t|
|
81
|
-
t.references table_name.sub(/^#{table_name_prefix}/, '').singularize,
|
81
|
+
t.references table_name.sub(/^#{table_name_prefix}/, '').singularize,
|
82
|
+
:null => false,
|
83
|
+
:index => false,
|
84
|
+
:type => column_type(model.primary_key).try(:to_sym),
|
85
|
+
:limit => model.columns.detect { |c| c.name == model.primary_key }.try(:limit)
|
82
86
|
t.string :locale, :null => false
|
83
87
|
t.timestamps :null => false
|
84
88
|
end
|
data/lib/globalize/version.rb
CHANGED
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: 5.
|
4
|
+
version: 5.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Fuchs
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2019-05-14 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: activerecord
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
version: '4.2'
|
26
26
|
- - "<"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '
|
28
|
+
version: '6.1'
|
29
29
|
type: :runtime
|
30
30
|
prerelease: false
|
31
31
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -35,7 +35,7 @@ dependencies:
|
|
35
35
|
version: '4.2'
|
36
36
|
- - "<"
|
37
37
|
- !ruby/object:Gem::Version
|
38
|
-
version: '
|
38
|
+
version: '6.1'
|
39
39
|
- !ruby/object:Gem::Dependency
|
40
40
|
name: activemodel
|
41
41
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,7 +45,7 @@ dependencies:
|
|
45
45
|
version: '4.2'
|
46
46
|
- - "<"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: '
|
48
|
+
version: '6.1'
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: '4.2'
|
56
56
|
- - "<"
|
57
57
|
- !ruby/object:Gem::Version
|
58
|
-
version: '
|
58
|
+
version: '6.1'
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
60
|
name: request_store
|
61
61
|
requirement: !ruby/object:Gem::Requirement
|
@@ -250,15 +250,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
250
250
|
requirements:
|
251
251
|
- - ">="
|
252
252
|
- !ruby/object:Gem::Version
|
253
|
-
version: 2.
|
253
|
+
version: 2.4.6
|
254
254
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
255
255
|
requirements:
|
256
256
|
- - ">="
|
257
257
|
- !ruby/object:Gem::Version
|
258
258
|
version: '0'
|
259
259
|
requirements: []
|
260
|
-
|
261
|
-
rubygems_version: 2.7.6
|
260
|
+
rubygems_version: 3.0.3
|
262
261
|
signing_key:
|
263
262
|
specification_version: 4
|
264
263
|
summary: Rails I18n de-facto standard library for ActiveRecord model/data translation
|