Fix all Layout/SpaceAroundOperators rubocop issues and remove file list from rubocop_todo list

This commit is contained in:
Bertocq
2017-06-26 18:04:20 +02:00
parent d7b8777395
commit f6fe9cc7d2
34 changed files with 80 additions and 86 deletions

View File

@@ -93,7 +93,7 @@ module Budgets
def set_random_seed
if params[:order] == 'random' || params[:order].blank?
params[:random_seed] ||= rand(99)/100.0
params[:random_seed] ||= rand(99) / 100.0
seed = Float(params[:random_seed]) rescue 0
Budget::Investment.connection.execute("select setseed(#{seed})")
else

View File

@@ -20,7 +20,7 @@ class Management::Budgets::InvestmentsController < Management::BaseController
@investment.author = managed_user
if @investment.save
notice= t('flash.actions.create.notice', resource_name: Budget::Investment.model_name.human, count: 1)
notice = t('flash.actions.create.notice', resource_name: Budget::Investment.model_name.human, count: 1)
redirect_to management_budget_investment_path(@budget, @investment), notice: notice
else
render :new

View File

@@ -1,7 +1,7 @@
module BallotsHelper
def progress_bar_width(amount_available, amount_spent)
(amount_spent/amount_available.to_f * 100).to_s + "%"
(amount_spent / amount_available.to_f * 100).to_s + "%"
end
end

View File

@@ -11,7 +11,7 @@ module EmbedVideosHelper
if server == "Vimeo"
reg_exp = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/
src = "https://player.vimeo.com/video/"
src = "https://player.vimeo.com/video/"
elsif server == "YouTube"
reg_exp = /youtu.*(be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/
src = "https://www.youtube.com/embed/"

View File

@@ -13,7 +13,7 @@ module OfficingHelper
officer_assignments.each do |oa|
options << [oa.booth_assignment.booth.name.to_s, oa.id]
end
options.sort! {|x, y| x[0]<=>y[0]}
options.sort! {|x, y| x[0] <=> y[0]}
options_for_select(options, params[:oa])
end

View File

@@ -9,7 +9,7 @@ module PollRecountsHelper
end
def booth_assignment_sum_final_recounts(ba)
ba.final_recounts.any? ? ba.final_recounts.to_a.sum(&:count) :nil
ba.final_recounts.any? ? ba.final_recounts.to_a.sum(&:count) : nil
end
end

View File

@@ -18,7 +18,7 @@ module VerificationHelper
data_to_mask = match[2]
email_provider = match[3]
data_to_display + "*"*data_to_mask.size + "@" + email_provider
data_to_display + "*" * data_to_mask.size + "@" + email_provider
end
end

View File

@@ -205,8 +205,8 @@ class Budget
end
def should_show_aside?
(budget.selecting? && !unfeasible?) ||
(budget.balloting? && feasible?) ||
(budget.selecting? && !unfeasible?) ||
(budget.balloting? && feasible?) ||
(budget.valuating? && !unfeasible?)
end

View File

@@ -64,7 +64,7 @@ class Comment < ActiveRecord::Base
end
def author=(author)
self.user= author
self.user = author
end
def total_votes

View File

@@ -3,7 +3,7 @@ module Conflictable
def conflictive?
return false unless flags_count > 0 && cached_votes_up > 0
cached_votes_up/flags_count.to_f < 5
cached_votes_up / flags_count.to_f < 5
end
end

View File

@@ -35,7 +35,7 @@ class Legislation::Annotation < ActiveRecord::Base
selector_end = "/html/body/#{range_end}"
el_end = doc.at_xpath(selector_end)
remainder_el_start = el_start.text[0 .. range_start_offset-1] unless range_start_offset.zero?
remainder_el_start = el_start.text[0 .. range_start_offset - 1] unless range_start_offset.zero?
remainder_el_end = el_end.text[range_end_offset .. -1]
self.context = "#{remainder_el_start}<span class=annotator-hl>#{quote}</span>#{remainder_el_end}"