False values for custom fields are now correctly exported. Fixes #250.
This commit is contained in:
parent
79bf38c419
commit
4ae6fe7977
@ -305,7 +305,7 @@ module Locomotive
|
|||||||
content.send(field.safe_alias.to_sym)
|
content.send(field.safe_alias.to_sym)
|
||||||
end)
|
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
|
end
|
||||||
|
|
||||||
data << { content.highlighted_field_value => hash }
|
data << { content.highlighted_field_value => hash }
|
||||||
|
@ -25,7 +25,8 @@ describe Locomotive::Export do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'deals with real booleans' do
|
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
|
end
|
||||||
|
|
||||||
it 'stores the list of highlighted values in a has_many relationship' do
|
it 'stores the list of highlighted values in a has_many relationship' do
|
||||||
|
Loading…
Reference in New Issue
Block a user