fix a bug when generating a content type: every required field was also marked as localized

did committed Oct 31, 2014
commit 171d9047f002de2e1b45f022c08b1ca954984c02
Showing 2 changed files with 2 additions and 2 deletions
generators/content_type/app/content_types/%slug%.yml.tt +1 -1
@@ @@ -32,7 +32,7 @@ fields: <% config[:fields].each_with_index do |field, index| %>
type: <%= field.type %>
required: <%= index == 0 ? true : field.required %>
hint: Explanatory text displayed in the back office
- localized: <%= field.required %><% if field.type == 'text' %>
+ localized: <%= field.localized %><% if field.type == 'text' %>
# text_formatting: html # html (uses rich text editor) or text (uses plain text editor)<% end -%><% if field.type == 'select' -%>
# if localized, use
# en: ['option1_en', 'option2_en']
locomotive/wagon/generators/content_type.rb b/lib/locomotive/wagon/generators/content_type.rb +1 -1
@@ @@ -43,7 +43,7 @@ module Locomotive
label: label || name.humanize,
type: type || 'string',
required: %w(true required).include?(required),
- localized: %w(true required).include?(localized)
+ localized: %w(true localized).include?(localized)
).tap do |field|
if %w(belongs_to has_many many_to_many).include?(type)
field.class_name = target_content_type_slug