5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-23 14:16:22 +00:00

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. # Configuration parameters: CountComments.
Metrics/ClassLength: Metrics/ClassLength:
Max: 379 Max: 379
Exclude:
- 'app/models/post.rb'
# Offense count: 6 # Offense count: 6
Metrics/CyclomaticComplexity: Metrics/CyclomaticComplexity:

View file

@ -353,6 +353,15 @@ class Post
next if REJECT_FROM_TEMPLATE.include? key next if REJECT_FROM_TEMPLATE.include? key
next if key.start_with? 'has_' 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) Post::TemplateField.new(self, key, contents)
end.compact end.compact
end end