From beb4bc119c638f046681e2c6cd7b40dac940fc5e Mon Sep 17 00:00:00 2001 From: Bertocq Date: Sun, 9 Jul 2017 00:37:03 +0200 Subject: [PATCH] Fix Rails/Delegate rubocop issue --- .rubocop_todo.yml | 6 ------ app/models/poll/question.rb | 4 +--- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 08a780ac1..c99c38d18 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -365,12 +365,6 @@ Performance/RedundantMatch: - 'app/controllers/valuation/spending_proposals_controller.rb' - 'app/helpers/embed_videos_helper.rb' -# Offense count: 1 -# Cop supports --auto-correct. -Rails/Delegate: - Exclude: - - 'app/models/poll/question.rb' - # Offense count: 5 # Cop supports --auto-correct. # Configuration parameters: Whitelist. diff --git a/app/models/poll/question.rb b/app/models/poll/question.rb index b67650a8d..28dd8ed4a 100644 --- a/app/models/poll/question.rb +++ b/app/models/poll/question.rb @@ -58,9 +58,7 @@ class Poll::Question < ActiveRecord::Base end end - def answerable_by?(user) - poll.answerable_by?(user) - end + delegate :answerable_by?, to: :poll def self.answerable_by(user) return none if user.nil? || user.unverified?