diff --git a/.rubocop.yml b/.rubocop.yml index e2cc2bf93..49de3550b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,8 @@ inherit_from: .rubocop_todo.yml AllCops: + DisplayCopNames: true + DisplayStyleGuide: true Include: - '**/Rakefile' - '**/config.ru' diff --git a/app/controllers/officing/polls_controller.rb b/app/controllers/officing/polls_controller.rb index 46bcf9f37..5ba94e024 100644 --- a/app/controllers/officing/polls_controller.rb +++ b/app/controllers/officing/polls_controller.rb @@ -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 diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb index f9c2e8c69..2cefcdf27 100644 --- a/app/helpers/admin_helper.rb +++ b/app/helpers/admin_helper.rb @@ -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| diff --git a/lib/census_api.rb b/lib/census_api.rb index 066c0be95..931781c6d 100644 --- a/lib/census_api.rb +++ b/lib/census_api.rb @@ -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 diff --git a/lib/document_parser.rb b/lib/document_parser.rb index c60b180dc..9e59c6b75 100644 --- a/lib/document_parser.rb +++ b/lib/document_parser.rb @@ -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) diff --git a/lib/local_census.rb b/lib/local_census.rb index 6c6e8fe12..1a0428787 100644 --- a/lib/local_census.rb +++ b/lib/local_census.rb @@ -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