awesome_translations 0.0.32 → 0.0.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/awesome_translations/caches_controller.rb +6 -1
- data/app/controllers/awesome_translations/duplicates_controller.rb +29 -0
- data/app/controllers/awesome_translations/movals_controller.rb +21 -0
- data/app/views/awesome_translations/caches/index.html.haml +2 -1
- data/app/views/awesome_translations/duplicates/index.html.haml +29 -0
- data/app/views/awesome_translations/movals/index.html.haml +29 -0
- data/app/views/layouts/awesome_translations/application.html.haml +2 -0
- data/config/routes.rb +2 -0
- data/lib/awesome_translations/cache_database_generator.rb +5 -5
- data/lib/awesome_translations/handlers/model_handler.rb +1 -1
- data/lib/awesome_translations/handlers/validations_handler.rb +1 -1
- data/lib/awesome_translations/model_inspector.rb +2 -2
- data/lib/awesome_translations/version.rb +1 -1
- data/spec/controllers/groups_controller_spec.rb +2 -0
- data/spec/controllers/handlers_controller_spec.rb +2 -0
- data/spec/dummy/db/awesome_translations.sqlite3 +0 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/log/test.log +2296 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-9/-9LnoNK9_y7lZLswQisHkJ2UgRiThUygUF2k-lwJ_ls.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-B/-BKq0W2BrZtpzQ_AE6U0cNZfVZAiBBtKj_54o3fKXEE.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-Y/-Y3C8keVTswdKKypfBu8DNrVjeqTFF_sFb6u-NwErI8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/-p/-p3cUMoKfAtCO4qhqFWot4duazbb5AAtCB0KlGme16I.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/19/19Hk4VAOmqXJVFnvyzbx9dA_zxm1HbytI8Fp2cZVvDk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/1H/1HSFdFAOn53CeKbEGRdZ5UtXV3IGwvOFkn9npTFHybA.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3B/3B8xzbg9yQEKPjOULkIqMtG6onClrStqkEtYgXBIbuM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/3Q/3QYJAti0uTWor5HsmsgVH7ULKl1iLk80hEpE1rQIs9U.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/4t/4tXPPRakNbNKRZi-N2Sbt9rkbKHtAcI2R9DbAbzdqWM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/5F/5FD4AksGQhYND3dvD8L0Gav_KBdx1j_BsfP20M5gNjY.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/70/703d9CW69pLOmWsMchfCwapMHEt_DMws2YORSoB7zlA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/BY/BY_wSbbC_Vf_v5VdeWtVUoCjVrio_SFPp86IjJhxxUk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Bt/Bt4RThqxXfldop-keF3zwyhIABv5l7kfH0SveZ5qS-k.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/CR/CR97dbTXkOfoCG4HW-piGw2YJrH5r6cDW9pQQ4dg1VU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Cl/CLskmtO-Ca-0Cs3s7u4oPD_NoVhPDHP7-85p7JJ1rZM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Dv/Dv6j8yp3M2FlO0yJc5dQq_ZkH64Uv2RMIC1QlVTW2_M.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/HM/HMF09E3WMjUQwNfgW97hIhQkDkER_FrvanmLa08YKt0.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ha/HaZccLN5AD27b6lFWtT2q7943SEik5AwcdGAy8fwEq4.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Ja/ja8HgAiXRpYEw3hZqTluVSiromVWlcNSnahmFbcTdSM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Je/jei9tDgw3VZMP_0-gt2LhicjEiKuYIUO0A8P4aiFXEU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Jf/Jfm5Xfq6MeP2KSFiyzntYlL-ikiSONPr-AO1PTKAuSg.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Jf/jfP6aNmLJuMJNBykxNzpNDB4j4cmW5egtXP-P9CyaD8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/MJ/MJRrJqYi45rqCa5G91QHbQpnDJw6j3O7PUqtFLi-pT8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/N6/N61Og0RuofmkMqxgtA1Ss0Psb72-Qsh-70mbQkyp-iM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/NM/NMNrcdzemgns1v1ue3rLEGBjL_agJSG8hH9LkyCTadM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/OO/OOJmA0X6E4PFfEk0JyWz0NVUyqmrh1gYUS0Cnxl0NOk.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Q0/Q0fP0TvloushTGRrWv8TmgmLUQZrhm5KjSSEBXRBn9A.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/Qy/QyUJtF-jqPNZi4zRMzWvHRTbp2_P6agh9LRdOsKO3co.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/RW/RWEgVffi5DVbeDudwWLbresUzfti_g_hYISQKcSVl2s.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/St/St24JHB50WNjkvhZzxV6AeT4KD0nAB3Hiwx5qXPCTTs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/TS/TSQTpLVMUDhzBO8yin5A90dOEI_Lwa3_PLlIYIv6biU.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/WW/WWIR79wBPYmAzmg31e_DrbXuw1jhhaT0pFGheXfdQyA.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XD/Xd43MJCo2eXbVv9ygbOZLJmgOTEgaxTHlHE-WbU6vn8.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/XV/XVISq-1bbtJ5ASCGpBJiGNj66H4TK-2x9eDW_pcStq4.cache +2 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/YG/YGZWmzflAg_kBxwD40tFjxBiHAvFMLGFhMYk6Wkhv3I.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/_i/_IONxRST3o6Se0O_b9tNGR6rZVzRzPJYt86WqKH1gxY.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ab/abSllpWlxGsHh9lHo3G4K2DfkwhlJlfP-p-iKiT_Vso.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ai/aiSouQuuKIy1EGEU-2-e5jrjNOqiEUNFtpkDecUTHUU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/c4/c4m8hAZBCmtA5pymNy9QejmDenSOB24jdvzAo7kn1No.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/d0/d0OkLJGmrabnrAVdoIthxFicjy51qSzTg_UNNEQi9t8.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/eA/EAB1wtjFRuekAAPsCRwnZx1mxL7zMPfRFjE-vv26zUQ.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/eJ/eJFaq3PdWBMT1xIayptRJuyqV-pgt13dD-uws6ythAM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/eP/EpHctXUYwSF9W5-BCIWGkigoRvEPkFLBsfnAt7LVpYs.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/gG/ggs463RsDbUq_iJuW2u4FQ9BIEE9R3d-W7LauwOgETc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ho/hOrS6tCHlhfMwq4dxfhN4ruOFOQ6bWpGILEhXXGBtcM.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/ho/hOzUf9VSzh9Bbs8ljChE_H3ULDtfluiT596gWUMXsxM.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/m7/m7C9CA-_VVI07nclz_DyfD3vo8BjFfpYBOQj825rs9A.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/oZ/oZa6FRbtMu9kIy-lo1Jotljy4bdeEi6BADWRNGyXDG4.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/uV/UVZyjPowI1lA18OvTbTrBh1tS1fQyvqA1woAJX8hjQk.cache +1 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/uX/uxaSF3JGDasF80jdtxkBX7Mc6W9RJb0zwYvrcavDrBc.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/wB/wBIjefZgzT0CLWoBTYVL2KnLSo8GFSTE--q-Qou6SrU.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/yO/yOpbZmjzfNHluAhueDoeqOHQMKsyOShfeyzXTLXyOKo.cache +0 -0
- data/spec/dummy/tmp/cache/assets/sprockets/v3.0/z-/z-wHmkAsx-4iceiCZ6GlLIg72izN6zW1Sp_8sYaX6RU.cache +0 -0
- data/spec/features/duplicates_spec.rb +51 -0
- data/spec/features/movals_spec.rb +54 -0
- data/spec/lib/cache_database_generator_spec.rb +1 -1
- data/spec/spec_helper.rb +6 -3
- metadata +104 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62fc7814794eb69cf8aaff33ba387830a3fd9c94
|
4
|
+
data.tar.gz: c33d0d75d58c58ff93da097607cc3a1e6a04f695
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24c1d69337fee4fc06266e8ca627902ba63f7cfc3b6a4967cd61693e3274cb79ec81e0101743ff12fc44be349ea956f98f4eefe794ccb145539e9adf2fcbfed3
|
7
|
+
data.tar.gz: b5326f7d4a6efc4084a638f40cce829ab27ff4c7ab691f47cf7d7a5c02fcf049f971939b56e371a378ad30f26a7c75cd342aeffda8387ffebef5b2de2730098d
|
@@ -4,7 +4,12 @@ class AwesomeTranslations::CachesController < AwesomeTranslations::ApplicationCo
|
|
4
4
|
|
5
5
|
def create
|
6
6
|
cache_db_generator = AwesomeTranslations::CacheDatabaseGenerator.new(debug: true)
|
7
|
-
|
7
|
+
|
8
|
+
if params[:cache] && params[:cache][:type] == "yml"
|
9
|
+
cache_db_generator.cache_yml_translations
|
10
|
+
else
|
11
|
+
cache_db_generator.cache_translations
|
12
|
+
end
|
8
13
|
|
9
14
|
flash[:notice] = "The cache was updated"
|
10
15
|
redirect_to caches_path
|
@@ -0,0 +1,29 @@
|
|
1
|
+
class AwesomeTranslations::DuplicatesController < AwesomeTranslations::ApplicationController
|
2
|
+
def index
|
3
|
+
@duplicates = AwesomeTranslations::CacheDatabaseGenerator::TranslationValue
|
4
|
+
.select("translation_values.*, duplicate_translation_values.id AS duplicate_id")
|
5
|
+
.joins("
|
6
|
+
INNER JOIN translation_values AS duplicate_translation_values ON
|
7
|
+
duplicate_translation_values.translation_key_id = translation_values.translation_key_id
|
8
|
+
")
|
9
|
+
.where("translation_values.id < duplicate_translation_values.id")
|
10
|
+
.where("translation_values.locale = duplicate_translation_values.locale")
|
11
|
+
end
|
12
|
+
|
13
|
+
def create
|
14
|
+
ids = []
|
15
|
+
params[:d].each do |translation_value_id, check_value|
|
16
|
+
ids << translation_value_id.to_i if check_value == "1"
|
17
|
+
end
|
18
|
+
|
19
|
+
translation_values = AwesomeTranslations::CacheDatabaseGenerator::TranslationValue
|
20
|
+
.where(id: ids)
|
21
|
+
|
22
|
+
translation_values.each do |translation_value|
|
23
|
+
AwesomeTranslations::TranslationMigrator.new(translation_value: translation_value).execute
|
24
|
+
translation_value.destroy!
|
25
|
+
end
|
26
|
+
|
27
|
+
redirect_to :back
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class AwesomeTranslations::MovalsController < AwesomeTranslations::ApplicationController
|
2
|
+
def index
|
3
|
+
@movals = AwesomeTranslations::CacheDatabaseGenerator::TranslationValue
|
4
|
+
.select("translation_values.*, handler_translations.id AS handler_translation_id")
|
5
|
+
.joins("
|
6
|
+
INNER JOIN handler_translations ON
|
7
|
+
handler_translations.translation_key_id = translation_values.translation_key_id
|
8
|
+
")
|
9
|
+
.where("translation_values.file_path NOT LIKE handler_translations.dir || '%'")
|
10
|
+
.group("translation_values.id")
|
11
|
+
end
|
12
|
+
|
13
|
+
def create
|
14
|
+
params[:m].each do |translation_value_id, _handler_translation_id|
|
15
|
+
translation_value = AwesomeTranslations::CacheDatabaseGenerator::TranslationValue.find(translation_value_id)
|
16
|
+
translation_value.migrate_to_awesome_translations_namespace!
|
17
|
+
end
|
18
|
+
|
19
|
+
redirect_to :back
|
20
|
+
end
|
21
|
+
end
|
@@ -1,3 +1,4 @@
|
|
1
1
|
%h1 Cache
|
2
2
|
|
3
|
-
= bb_btn caches_path, "Update cache",
|
3
|
+
= bb_btn caches_path, "Update cache", :confirm, method: :post, class: "btn-primary"
|
4
|
+
= bb_btn caches_path(cache: {type: "yml"}), "Update YML cache", :confirm, method: :post
|
@@ -0,0 +1,29 @@
|
|
1
|
+
- content_for(:header_title) { "Duplicates" }
|
2
|
+
|
3
|
+
= simple_form_for :duplicates do |f|
|
4
|
+
- count = 0
|
5
|
+
|
6
|
+
= bb_panel table: true do
|
7
|
+
%thead
|
8
|
+
%tr
|
9
|
+
%th
|
10
|
+
%th Key
|
11
|
+
%th Path
|
12
|
+
%th Other path
|
13
|
+
%tbody
|
14
|
+
- @duplicates.each do |duplicate|
|
15
|
+
- count += 1
|
16
|
+
- other = AwesomeTranslations::CacheDatabaseGenerator::TranslationValue.find(duplicate.duplicate_id)
|
17
|
+
|
18
|
+
%tr
|
19
|
+
%td= check_box_tag "d[#{other.id}]", 1, true
|
20
|
+
%td= duplicate.key
|
21
|
+
%td= path_without_root_or_locales duplicate.file_path
|
22
|
+
%td= path_without_root_or_locales other.file_path
|
23
|
+
- if count == 0
|
24
|
+
%tr
|
25
|
+
%td{colspan: 4} No duplicates was found
|
26
|
+
|
27
|
+
- if count > 0
|
28
|
+
= bb_panel do
|
29
|
+
= f.button :submit, "Delete duplicates"
|
@@ -0,0 +1,29 @@
|
|
1
|
+
- content_for(:header_title) { "Movals" }
|
2
|
+
|
3
|
+
= simple_form_for :movals do |f|
|
4
|
+
- count = 0
|
5
|
+
|
6
|
+
= bb_panel table: true do
|
7
|
+
%thead
|
8
|
+
%tr
|
9
|
+
%th
|
10
|
+
%th Key
|
11
|
+
%th Path
|
12
|
+
%th Right path
|
13
|
+
%tbody
|
14
|
+
- @movals.each do |moval|
|
15
|
+
- handler_translation = AwesomeTranslations::CacheDatabaseGenerator::HandlerTranslation.find(moval.handler_translation_id)
|
16
|
+
- count += 1
|
17
|
+
|
18
|
+
%tr
|
19
|
+
%td= check_box_tag "m[#{moval.id}]", handler_translation.id, true
|
20
|
+
%td= moval.key
|
21
|
+
%td= path_without_root_or_locales moval.file_path
|
22
|
+
%td= path_without_root_or_locales "#{handler_translation.dir}/#{moval.locale}.yml"
|
23
|
+
- if count <= 0
|
24
|
+
%tr
|
25
|
+
%td{colspan: 4} No wrongly placed translations was found
|
26
|
+
|
27
|
+
- if count > 0
|
28
|
+
= bb_panel do
|
29
|
+
= f.button :submit, "Move"
|
@@ -28,7 +28,9 @@
|
|
28
28
|
%li= link_to "Handlers", handlers_path
|
29
29
|
%li= link_to "Translations", handler_translations_path
|
30
30
|
%li= link_to "Clean Up", new_clean_up_path
|
31
|
+
%li= link_to "Duplicates", duplicates_path
|
31
32
|
%li= link_to "Migrate", new_migration_path
|
33
|
+
%li= link_to "Movals", movals_path
|
32
34
|
%li= link_to "Cache", caches_path
|
33
35
|
|
34
36
|
.container
|
data/config/routes.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
AwesomeTranslations::Engine.routes.draw do
|
2
2
|
resources :caches
|
3
3
|
resources :clean_ups, only: [:new, :create]
|
4
|
+
resources :duplicates, only: [:index, :create]
|
4
5
|
|
5
6
|
resources :handlers, only: [:index, :show] do
|
6
7
|
post :update_cache, on: :collection
|
@@ -13,6 +14,7 @@ AwesomeTranslations::Engine.routes.draw do
|
|
13
14
|
|
14
15
|
resources :handler_translations, only: :index
|
15
16
|
resources :migrations, only: [:new, :create]
|
17
|
+
resources :movals, only: [:index, :create]
|
16
18
|
|
17
19
|
root to: "handlers#index"
|
18
20
|
end
|
@@ -23,6 +23,8 @@ class AwesomeTranslations::CacheDatabaseGenerator
|
|
23
23
|
@initialized = true
|
24
24
|
@db = Baza::Db.new(type: :sqlite3, path: database_path, debug: false, type_translation: true)
|
25
25
|
|
26
|
+
BazaModels.primary_db = @db
|
27
|
+
|
26
28
|
AwesomeTranslations::CacheDatabaseGenerator::Group.db = @db
|
27
29
|
AwesomeTranslations::CacheDatabaseGenerator::Group.table_name = "groups"
|
28
30
|
|
@@ -241,12 +243,10 @@ private
|
|
241
243
|
|
242
244
|
translation_value = AwesomeTranslations::CacheDatabaseGenerator::TranslationValue.find_or_initialize_by(
|
243
245
|
translation_key_id: translation_key.id,
|
244
|
-
locale: locale
|
245
|
-
|
246
|
-
translation_value.assign_attributes(
|
247
|
-
file_path: file_path,
|
248
|
-
value: value
|
246
|
+
locale: locale,
|
247
|
+
file_path: file_path
|
249
248
|
)
|
249
|
+
translation_value.assign_attributes(value: value)
|
250
250
|
translation_value.save!
|
251
251
|
|
252
252
|
@translation_values_found[translation_value.id] = true
|
@@ -13,7 +13,7 @@ class AwesomeTranslations::Handlers::ModelHandler < AwesomeTranslations::Handler
|
|
13
13
|
def translations_for_group(group)
|
14
14
|
ArrayEnumerator.new do |yielder|
|
15
15
|
model_inspector = AwesomeTranslations::ModelInspector.model_classes.find { |model_inspector| model_inspector.clazz.name == group.name }
|
16
|
-
raise "No inspector by that name: #{
|
16
|
+
raise "No inspector by that name: #{group.name}" unless model_inspector
|
17
17
|
|
18
18
|
model_names(model_inspector).each { |translation| yielder << translation }
|
19
19
|
active_record_attributes(model_inspector).each { |translation| yielder << translation }
|
@@ -13,7 +13,7 @@ class AwesomeTranslations::Handlers::ValidationsHandler < AwesomeTranslations::H
|
|
13
13
|
def translations_for_group(group)
|
14
14
|
ArrayEnumerator.new do |yielder|
|
15
15
|
model_inspector = AwesomeTranslations::ModelInspector.model_classes.find { |model_inspector| model_inspector.clazz.name == group.name }
|
16
|
-
raise "No inspector by that name: #{
|
16
|
+
raise "No inspector by that name: #{group.name}" unless model_inspector
|
17
17
|
|
18
18
|
model_inspector.clazz._validators.each do |attribute_name, validators|
|
19
19
|
validators.each do |validator|
|
@@ -92,8 +92,8 @@ class AwesomeTranslations::ModelInspector
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def self.find_subclasses(clazz, &blk)
|
95
|
-
return if @scanned[clazz]
|
96
|
-
@scanned[clazz] = true
|
95
|
+
return if @scanned[clazz.name]
|
96
|
+
@scanned[clazz.name] = true
|
97
97
|
|
98
98
|
clazz.subclasses.each do |subclass|
|
99
99
|
blk.call ::AwesomeTranslations::ModelInspector.new(subclass)
|
@@ -9,6 +9,8 @@ describe AwesomeTranslations::GroupsController do
|
|
9
9
|
let(:date_time_path) { Rails.root.join("config", "locales", "awesome_translations", "date_time", "da.yml").to_s }
|
10
10
|
|
11
11
|
before do
|
12
|
+
AwesomeTranslations::CacheDatabaseGenerator.current.cache_translations
|
13
|
+
|
12
14
|
FileUtils.rm_f(model_locales_path) if File.exist?(model_locales_path)
|
13
15
|
FileUtils.rm_f(date_time_path) if File.exist?(date_time_path)
|
14
16
|
|
@@ -12,6 +12,7 @@ describe AwesomeTranslations::HandlersController do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it "#show" do
|
15
|
+
AwesomeTranslations::CacheDatabaseGenerator.current.cache_translations
|
15
16
|
get :show, id: "model_handler"
|
16
17
|
expect(response).to be_success
|
17
18
|
end
|
@@ -23,6 +24,7 @@ describe AwesomeTranslations::HandlersController do
|
|
23
24
|
end
|
24
25
|
|
25
26
|
it "#update_groups_cache" do
|
27
|
+
AwesomeTranslations::CacheDatabaseGenerator.current.cache_translations
|
26
28
|
request.env["HTTP_REFERER"] = handler_path("rails_handler")
|
27
29
|
post :update_groups_cache, id: "rails_handler"
|
28
30
|
expect(response).to redirect_to handler_path("rails_handler")
|
Binary file
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|