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:
parent
091f5e7be3
commit
dfe2895b60
2 changed files with 11 additions and 0 deletions
|
@ -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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue