does not need to fill all the fields of a content type during the theme import

This commit is contained in:
did 2011-03-23 11:01:49 +01:00
parent ce5f0de165
commit 67fba7542c

View File

@ -74,6 +74,8 @@ module Locomotive
attributes.each do |name, value|
field = content_type.content_custom_fields.detect { |f| f._alias == name }
next if field.nil? # the attribute name is not related to a field (name misspelled ?)
value = (case field.kind.downcase
when 'file' then self.open_sample_asset(value)
when 'boolean' then Boolean.set(value)