From dfe2895b601d648c848446742282558d3c10eae2 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 29 Apr 2019 19:49:24 -0300 Subject: [PATCH] no fallar con el titulo --- .rubocop_todo.yml | 2 ++ app/models/post.rb | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9c62a5d..f6ddd68 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -68,6 +68,8 @@ Metrics/BlockLength: # Configuration parameters: CountComments. Metrics/ClassLength: Max: 379 + Exclude: + - 'app/models/post.rb' # Offense count: 6 Metrics/CyclomaticComplexity: diff --git a/app/models/post.rb b/app/models/post.rb index 3ffc107..a29471c 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -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