diff --git a/lib/locomotive/export.rb b/lib/locomotive/export.rb index 602e2440..78aab45f 100644 --- a/lib/locomotive/export.rb +++ b/lib/locomotive/export.rb @@ -305,7 +305,7 @@ module Locomotive content.send(field.safe_alias.to_sym) end) - hash[field._alias] = value unless value.blank? + hash[field._alias] = value if value.present? || value == false # False values should be preserved in the export end data << { content.highlighted_field_value => hash } diff --git a/spec/lib/locomotive/export_spec.rb b/spec/lib/locomotive/export_spec.rb index 6faa2b63..da169829 100644 --- a/spec/lib/locomotive/export_spec.rb +++ b/spec/lib/locomotive/export_spec.rb @@ -25,7 +25,8 @@ describe Locomotive::Export do end it 'deals with real booleans' do - @project_data.first.values.first['active'].should be_true + @project_data.first.values.first['active'].should === true + @project_data.last.values.first['active'].should === false end it 'stores the list of highlighted values in a has_many relationship' do