mobility-actiontext 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +2 -2
- data/lib/mobility/action_text/version.rb +1 -1
- data/lib/mobility/backends/action_text.rb +2 -1
- data/test_app/Gemfile.lock +4 -6
- data/test_app/config/initializers/i18n.rb +1 -1
- data/test_app/test/fixtures/action_text/rich_texts.yml +6 -0
- data/test_app/test/mobility_action_text_test.rb +15 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7c9e89d17b9b01aa84055f4c34a75e258c1cffd7c35198dae1957b53fde7b5f
|
4
|
+
data.tar.gz: 255c73717d866912ebc0b020df39d1641f58f458130b89b67e35cba965a27391
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9c02385dc9cbd7fd035e5a9e81e651c5948b20c65fd5c86768b5dcd12ffce04a7a1293784a685629c0b12e31ac1ffb5340ea93cc4205f9290aea812364309e6
|
7
|
+
data.tar.gz: b5cf0bd2baf3c180a40047767899b48921b5d42cc67f8ca7d3e741fbe0e751b2fc54595e7e58cdbbd8faf8dac6ea15e94fabf999948de744eec314851894eace
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mobility-actiontext (1.1.
|
4
|
+
mobility-actiontext (1.1.1)
|
5
5
|
actiontext (>= 6.0)
|
6
6
|
mobility (~> 1.2)
|
7
7
|
|
@@ -56,7 +56,7 @@ GEM
|
|
56
56
|
activesupport (>= 5.0)
|
57
57
|
i18n (1.10.0)
|
58
58
|
concurrent-ruby (~> 1.0)
|
59
|
-
loofah (2.
|
59
|
+
loofah (2.16.0)
|
60
60
|
crass (~> 1.0.2)
|
61
61
|
nokogiri (>= 1.5.9)
|
62
62
|
marcel (1.0.2)
|
@@ -84,7 +84,8 @@ module Mobility
|
|
84
84
|
class_name: 'Mobility::Backends::ActionText::RichTextTranslation',
|
85
85
|
as: :record, inverse_of: :record, autosave: true, dependent: :destroy
|
86
86
|
Mobility.available_locales.each do |locale|
|
87
|
-
has_one :"rich_text_#{name}_#{locale}",
|
87
|
+
has_one :"rich_text_#{name}_#{locale.to_s.underscore}",
|
88
|
+
-> { where(name: name, locale: locale) },
|
88
89
|
class_name: 'Mobility::Backends::ActionText::RichTextTranslation',
|
89
90
|
as: :record, inverse_of: :record, autosave: true, dependent: :destroy
|
90
91
|
end
|
data/test_app/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ..
|
3
3
|
specs:
|
4
|
-
mobility-actiontext (1.1.
|
4
|
+
mobility-actiontext (1.1.1)
|
5
5
|
actiontext (>= 6.0)
|
6
6
|
mobility (~> 1.2)
|
7
7
|
|
@@ -85,14 +85,13 @@ GEM
|
|
85
85
|
activesupport (>= 5.0)
|
86
86
|
i18n (1.10.0)
|
87
87
|
concurrent-ruby (~> 1.0)
|
88
|
-
io-wait (0.2.1)
|
89
88
|
jbuilder (2.11.5)
|
90
89
|
actionview (>= 5.0.0)
|
91
90
|
activesupport (>= 5.0.0)
|
92
91
|
listen (3.7.1)
|
93
92
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
94
93
|
rb-inotify (~> 0.9, >= 0.9.10)
|
95
|
-
loofah (2.
|
94
|
+
loofah (2.16.0)
|
96
95
|
crass (~> 1.0.2)
|
97
96
|
nokogiri (>= 1.5.9)
|
98
97
|
mail (2.7.1)
|
@@ -112,8 +111,7 @@ GEM
|
|
112
111
|
digest
|
113
112
|
net-protocol
|
114
113
|
timeout
|
115
|
-
net-protocol (0.1.
|
116
|
-
io-wait
|
114
|
+
net-protocol (0.1.3)
|
117
115
|
timeout
|
118
116
|
net-smtp (0.3.1)
|
119
117
|
digest
|
@@ -124,7 +122,7 @@ GEM
|
|
124
122
|
racc (~> 1.4)
|
125
123
|
nokogiri (1.13.3-x86_64-linux)
|
126
124
|
racc (~> 1.4)
|
127
|
-
puma (5.6.
|
125
|
+
puma (5.6.4)
|
128
126
|
nio4r (~> 2.0)
|
129
127
|
racc (1.6.0)
|
130
128
|
rack (2.2.3)
|
@@ -22,6 +22,12 @@ post_one_content_fr:
|
|
22
22
|
locale: fr
|
23
23
|
body: <h1>Bonjour le monde !</h1>
|
24
24
|
|
25
|
+
post_one_content_fr_ca:
|
26
|
+
record: one (Post)
|
27
|
+
name: content
|
28
|
+
locale: fr-CA
|
29
|
+
body: <h1>Allo le monde !</h1>
|
30
|
+
|
25
31
|
post_one_non_i18n_content:
|
26
32
|
record: one (Post)
|
27
33
|
name: non_i18n_content
|
@@ -34,10 +34,10 @@ module Mobility
|
|
34
34
|
assert_equal 2, post.plain_text_translations.count
|
35
35
|
end
|
36
36
|
|
37
|
-
test 'post has
|
37
|
+
test 'post has three rich text translations' do
|
38
38
|
post = posts(:one)
|
39
39
|
|
40
|
-
assert_equal
|
40
|
+
assert_equal 3, post.rich_text_translations.count
|
41
41
|
end
|
42
42
|
|
43
43
|
test 'post has plain text title' do
|
@@ -60,19 +60,29 @@ module Mobility
|
|
60
60
|
test 'post has rich text content associations for each locale' do
|
61
61
|
post = posts(:one)
|
62
62
|
|
63
|
-
assert_instance_of Mobility::Backends::ActionText::RichTextTranslation,
|
63
|
+
assert_instance_of Mobility::Backends::ActionText::RichTextTranslation,
|
64
|
+
post.rich_text_content_en
|
64
65
|
assert_equal <<~HTML, post.rich_text_content_en.to_s
|
65
66
|
<div class="trix-content">
|
66
67
|
<h1>Hello world!</h1>
|
67
68
|
</div>
|
68
69
|
HTML
|
69
70
|
|
70
|
-
assert_instance_of Mobility::Backends::ActionText::RichTextTranslation,
|
71
|
+
assert_instance_of Mobility::Backends::ActionText::RichTextTranslation,
|
72
|
+
post.rich_text_content_fr
|
71
73
|
assert_equal <<~HTML, post.rich_text_content_fr.to_s
|
72
74
|
<div class="trix-content">
|
73
75
|
<h1>Bonjour le monde !</h1>
|
74
76
|
</div>
|
75
77
|
HTML
|
78
|
+
|
79
|
+
assert_instance_of Mobility::Backends::ActionText::RichTextTranslation,
|
80
|
+
post.rich_text_content_fr_ca
|
81
|
+
assert_equal <<~HTML, post.rich_text_content_fr_ca.to_s
|
82
|
+
<div class="trix-content">
|
83
|
+
<h1>Allo le monde !</h1>
|
84
|
+
</div>
|
85
|
+
HTML
|
76
86
|
end
|
77
87
|
|
78
88
|
test 'post has different content in different languages' do
|
@@ -150,7 +160,7 @@ module Mobility
|
|
150
160
|
end
|
151
161
|
|
152
162
|
test 'post is being destroyed' do
|
153
|
-
assert_difference ->{Mobility::Backends::ActionText::RichTextTranslation.count}, -
|
163
|
+
assert_difference ->{Mobility::Backends::ActionText::RichTextTranslation.count}, -6 do
|
154
164
|
assert posts(:one).destroy
|
155
165
|
end
|
156
166
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mobility-actiontext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sébastien Dubois
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03
|
11
|
+
date: 2022-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actiontext
|