Merge pull request #1894 from consul/chore/rubocop

🤖  Rubocop fixes and config
This commit is contained in:
BertoCQ
2017-09-25 19:12:06 +02:00
committed by GitHub
6 changed files with 8 additions and 6 deletions

View File

@@ -1,6 +1,8 @@
inherit_from: .rubocop_todo.yml
AllCops:
DisplayCopNames: true
DisplayStyleGuide: true
Include:
- '**/Rakefile'
- '**/config.ru'

View File

@@ -7,7 +7,7 @@ class Officing::PollsController < Officing::BaseController
def final
@polls = if current_user.poll_officer?
current_user.poll_officer.final_days_assigned_polls.select {|poll| poll.ends_at > 2.week.ago && poll.expired?}
current_user.poll_officer.final_days_assigned_polls.select {|poll| poll.ends_at > 2.weeks.ago && poll.expired?}
else
[]
end

View File

@@ -25,7 +25,7 @@ module AdminHelper
end
def menu_polls?
["polls", "questions", "officers", "booths", "officer_assignments", "booth_assignments", "recounts", "results", "shifts"].include? controller_name
%w[polls questions officers booths officer_assignments booth_assignments recounts results shifts].include? controller_name
end
def menu_profiles?
@@ -39,7 +39,7 @@ module AdminHelper
def menu_customization?
["pages", "images", "content_blocks"].include? controller_name
end
def official_level_options
options = [["", 0]]
(1..5).each do |i|

View File

@@ -119,7 +119,7 @@ class CensusApi
{get_habita_datos_response: {get_habita_datos_return: {datos_habitante: {}, datos_vivienda: {}}}}
end
def is_dni?(document_type)
def dni?(document_type)
document_type.to_s == "1"
end

View File

@@ -5,7 +5,7 @@ module DocumentParser
document_number = document_number.to_s.gsub(/[^0-9A-Za-z]/i, '')
variants = []
if is_dni?(document_type)
if dni?(document_type)
document_number, letter = split_letter_from(document_number)
number_variants = get_number_variants_with_leading_zeroes_from(document_number)
letter_variants = get_letter_variants(number_variants, letter)

View File

@@ -63,7 +63,7 @@ class LocalCensus
LocalCensusRecord.find_by(document_type: document_type, document_number: document_number)
end
def is_dni?(document_type)
def dni?(document_type)
document_type.to_s == "1"
end