rubocop noise: switched to predicate comparisons
Also introduced because of .ruby-version specification http://www.rubydoc.info/gems/rubocop/RuboCop/Cop/Style/NumericPredicate
This commit is contained in:
parent
4bbd93ded1
commit
9f23a5d3ce
@ -12,7 +12,7 @@ class CandidateController < ApplicationController
|
||||
end
|
||||
|
||||
def welcome
|
||||
render :welcome_back if current_candidate.answers.count > 0
|
||||
render :welcome_back if current_candidate.answers.count.positive?
|
||||
end
|
||||
|
||||
def saved
|
||||
|
@ -2,7 +2,7 @@
|
||||
class InputOptionsPresenceValidator < ActiveModel::EachValidator
|
||||
def validate_each(record, attribute, value)
|
||||
return true unless record.input_type =~ /radio|check/i
|
||||
return true if value.present? && value.count > 0
|
||||
return true if value.present? && value.count.positive?
|
||||
|
||||
record.errors[attribute] << (options[:message] ||
|
||||
"You must provide answer options for the selected input type.")
|
||||
|
@ -7,7 +7,7 @@ class QuizStatus
|
||||
end
|
||||
|
||||
def started
|
||||
candidate.answers.count > 0
|
||||
candidate.answers.count.positive?
|
||||
end
|
||||
|
||||
def on_summary
|
||||
|
Loading…
Reference in New Issue
Block a user