fix a bug preventing the developer to define a slug of a content entry inside a YAML file

did committed Dec 07, 2017
commit bf09e36a9f70963bbef275e22dfb269f6c417812
Showing 2 changed files with 12 additions and 2 deletions
locomotive/steam/models/i18n_field.rb b/lib/locomotive/steam/models/i18n_field.rb +4 -2
@@ @@ -40,8 +40,10 @@ module Locomotive::Steam
end
def blank?
- @translations.blank? ||
- @translations.values.all? { |v| v.blank? }
+ @translations.default.blank? && (
+ @translations.blank? ||
+ @translations.values.all? { |v| v.blank? }
+ )
end
def apply(&block)
spec/unit/models/i18n_field_spec.rb +8 -0
@@ @@ -20,6 +20,14 @@ describe Locomotive::Steam::Models::I18nField do
end
+ context 'with a single value' do
+
+ let(:translations) { 'Hello world' }
+
+ it { is_expected.to eq false }
+
+ end
+
end
describe '#dup' do