False values for custom fields are now correctly exported. Fixes #250.

This commit is contained in:
Mario Visic 2011-12-15 22:11:54 +08:00
parent 79bf38c419
commit 4ae6fe7977
2 changed files with 3 additions and 2 deletions

View File

@ -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 }

View File

@ -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