no fallar con el titulo

This commit is contained in:
f 2019-04-29 19:49:24 -03:00
parent 091f5e7be3
commit dfe2895b60
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
2 changed files with 11 additions and 0 deletions

View file

@ -68,6 +68,8 @@ Metrics/BlockLength:
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 379
Exclude:
- 'app/models/post.rb'
# Offense count: 6
Metrics/CyclomaticComplexity:

View file

@ -353,6 +353,15 @@ class Post
next if REJECT_FROM_TEMPLATE.include? key
next if key.start_with? 'has_'
# XXX: Esto está acá hasta que convirtamos todo en plantillas
if key == 'title' && content.is_a?(String)
contents = {
'value' => 'text',
'label' => I18n.t('posts.title'),
'required' => true
}
end
Post::TemplateField.new(self, key, contents)
end.compact
end