tolk 4.1.1 → 4.2.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
- data/app/models/tolk/locale.rb +12 -4
- data/app/views/tolk/{_blank_canva.svg → _blank_canva.html.erb} +0 -0
- data/app/views/tolk/{_empty.svg → _empty.html.erb} +0 -0
- data/app/views/tolk/{_houra.svg → _houra.html.erb} +0 -0
- data/app/views/tolk/{_no_data.svg → _no_data.html.erb} +0 -0
- data/app/views/tolk/locales/all.html.erb +1 -1
- data/app/views/tolk/locales/index.html.erb +1 -1
- data/app/views/tolk/locales/show.html.erb +1 -1
- data/app/views/tolk/searches/show.html.erb +1 -1
- data/lib/tolk/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0efb83ba668b7ce45dd8416a130ca95005466ca091664aed126905ba70e07031
|
4
|
+
data.tar.gz: 50bd892173a79fcf5f520600308a2726a0c724e89c7c6ec04f8938bbaae5d084
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab3b4d111fc73221f2c8e911e0c5fb7cdfe9a3fdb74d3de4dda3b750761b0e7fc2395358855eb18e76da8911f37351fc5298638a986229835518d436154030cb
|
7
|
+
data.tar.gz: bf73bddbb7e574ef04041cee9375e4db0d460680a891b0fc2b24fbbd3bdf84b643afbadb8dd793543d051c65396ccf5b483f1250fb258aea084d2110d61966d1
|
data/app/models/tolk/locale.rb
CHANGED
@@ -107,7 +107,9 @@ module Tolk
|
|
107
107
|
phrases = phrases.where('tolk_phrases.id NOT IN (?)', existing_ids) if existing_ids.present?
|
108
108
|
|
109
109
|
result = phrases.public_send(pagination_method, page)
|
110
|
-
if Rails.version
|
110
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('7')
|
111
|
+
ActiveRecord::Associations::Preloader.new(records: result, associations: :translations).call
|
112
|
+
elsif Rails.version =~ /^4\.0/
|
111
113
|
ActiveRecord::Associations::Preloader.new result, :translations
|
112
114
|
else
|
113
115
|
ActiveRecord::Associations::Preloader.new().preload(result, :translations)
|
@@ -143,7 +145,9 @@ module Tolk
|
|
143
145
|
# phrases = phrases.scoped(:conditions => ['tolk_phrases.id NOT IN (?) AND tolk_phrases.id IN(?)', existing_ids, found_translations_ids]) if existing_ids.present?
|
144
146
|
phrases = phrases.where(['tolk_phrases.id NOT IN (?) AND tolk_phrases.id IN(?)', existing_ids, found_translations_ids]) if existing_ids.present?
|
145
147
|
result = phrases.public_send(pagination_method, page)
|
146
|
-
if Rails.version
|
148
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('7')
|
149
|
+
ActiveRecord::Associations::Preloader.new(records: result, associations: :translations).call
|
150
|
+
elsif Rails.version =~ /^4\.0/
|
147
151
|
ActiveRecord::Associations::Preloader.new result, :translations
|
148
152
|
else
|
149
153
|
ActiveRecord::Associations::Preloader.new().preload(result, :translations)
|
@@ -186,7 +190,9 @@ module Tolk
|
|
186
190
|
def translations_with_html
|
187
191
|
translations = self.translations.all(:conditions => "tolk_translations.text LIKE '%>%' AND
|
188
192
|
tolk_translations.text LIKE '%<%' AND tolk_phrases.key NOT LIKE '%_html'", :joins => :phrase)
|
189
|
-
if Rails.version
|
193
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('7')
|
194
|
+
ActiveRecord::Associations::Preloader.new(records: result, associations: :translations).call
|
195
|
+
elsif Rails.version =~ /^4\.0/
|
190
196
|
ActiveRecord::Associations::Preloader.new translations, :phrase
|
191
197
|
else
|
192
198
|
ActiveRecord::Associations::Preloader.new().preload(translations, :phrase)
|
@@ -230,7 +236,9 @@ module Tolk
|
|
230
236
|
phrase.translation = phrase.translations.for(self)
|
231
237
|
end
|
232
238
|
|
233
|
-
if Rails.version
|
239
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('7')
|
240
|
+
ActiveRecord::Associations::Preloader.new(records: result, associations: :translations).call
|
241
|
+
elsif Rails.version =~ /^4\.0/
|
234
242
|
ActiveRecord::Associations::Preloader.new result, :translations
|
235
243
|
else
|
236
244
|
ActiveRecord::Associations::Preloader.new().preload(result, :translations)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/lib/tolk/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tolk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2022-
|
15
|
+
date: 2022-03-28 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: rails
|
@@ -185,11 +185,11 @@ files:
|
|
185
185
|
- app/models/tolk/phrase.rb
|
186
186
|
- app/models/tolk/translation.rb
|
187
187
|
- app/views/layouts/tolk/application.html.erb
|
188
|
-
- app/views/tolk/_blank_canva.
|
189
|
-
- app/views/tolk/_empty.
|
190
|
-
- app/views/tolk/_houra.
|
188
|
+
- app/views/tolk/_blank_canva.html.erb
|
189
|
+
- app/views/tolk/_empty.html.erb
|
190
|
+
- app/views/tolk/_houra.html.erb
|
191
191
|
- app/views/tolk/_nav.html.erb
|
192
|
-
- app/views/tolk/_no_data.
|
192
|
+
- app/views/tolk/_no_data.html.erb
|
193
193
|
- app/views/tolk/locales/all.html.erb
|
194
194
|
- app/views/tolk/locales/index.html.erb
|
195
195
|
- app/views/tolk/locales/show.atom.builder
|