mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-23 11:56:22 +00:00
no fallar con el titulo
This commit is contained in:
parent
091f5e7be3
commit
dfe2895b60
2 changed files with 11 additions and 0 deletions
|
@ -68,6 +68,8 @@ Metrics/BlockLength:
|
|||
# Configuration parameters: CountComments.
|
||||
Metrics/ClassLength:
|
||||
Max: 379
|
||||
Exclude:
|
||||
- 'app/models/post.rb'
|
||||
|
||||
# Offense count: 6
|
||||
Metrics/CyclomaticComplexity:
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue