Fix Rails/Delegate rubocop issue

This commit is contained in:
Bertocq
2017-07-09 00:37:03 +02:00
parent 4e0d88739d
commit beb4bc119c
2 changed files with 1 additions and 9 deletions

View File

@@ -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.

View File

@@ -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?