efficient_translations 0.0.6 → 0.0.7
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.
data/Gemfile.lock
CHANGED
@@ -54,7 +54,7 @@ describe EfficientTranslations do
|
|
54
54
|
end
|
55
55
|
end
|
56
56
|
|
57
|
-
|
57
|
+
describe '::WorkingModel' do
|
58
58
|
it 'should include the translation model' do
|
59
59
|
WorkingModel.translation_model.should be_kind_of(Class)
|
60
60
|
end
|
@@ -69,6 +69,17 @@ describe EfficientTranslations do
|
|
69
69
|
WorkingModel.should respond_to :with_translation_for
|
70
70
|
end
|
71
71
|
|
72
|
+
describe '::with_current_translation' do
|
73
|
+
it 'should return only items with translations for I18n.locale or I18n.default_locale' do
|
74
|
+
I18n.locale, I18n.default_locale = :en, :it
|
75
|
+
WorkingModel.delete_all
|
76
|
+
WorkingModel.create! :translations_attributes => [{:locale => :en, :name => 'pippo'}]
|
77
|
+
WorkingModel.create! :translations_attributes => [{:locale => :it, :name => 'pippo'}]
|
78
|
+
WorkingModel.create! :translations_attributes => [{:locale => :fr, :name => 'pippo'}]
|
79
|
+
WorkingModel.with_current_translation.size.should == 2
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
72
83
|
it 'should accept nested attributes' do
|
73
84
|
WorkingModel.delete_all
|
74
85
|
WorkingModel.create! :translations_attributes => [{ :locale => :en, :name => 'pippo' }]
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: efficient_translations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 7
|
10
|
+
version: 0.0.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Nicola Racco
|