diff --git a/.rubocop.yml b/.rubocop.yml index 702bbb64f..e4dd7520c 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -382,6 +382,9 @@ Style/ClassVars: Style/CollectionMethods: Enabled: true +Style/HashSyntax: + Enabled: true + Style/Not: Enabled: true diff --git a/app/views/legislation/processes/resume_to_xlsx.xlsx.axlsx b/app/views/legislation/processes/resume_to_xlsx.xlsx.axlsx index 6f120a3cb..6dd1ebd65 100644 --- a/app/views/legislation/processes/resume_to_xlsx.xlsx.axlsx +++ b/app/views/legislation/processes/resume_to_xlsx.xlsx.axlsx @@ -5,10 +5,10 @@ wb.add_worksheet(name: "Resume") do |sheet| sheet.add_row [t("legislation.summary.debates_phase"), t("legislation.questions.question.total", count: @process.questions.count)] @process.questions.each do |question| sheet.add_row [question.title, t("legislation.summary.comments", count: question.comments.count)] - sheet.add_hyperlink :location => legislation_process_question_url(question.process, question), :ref => sheet.rows.last.cells.first + sheet.add_hyperlink location: legislation_process_question_url(question.process, question), ref: sheet.rows.last.cells.first question.best_comments(3).each do |comment| sheet.add_row [comment.body, (comment.cached_votes_up - comment.cached_votes_down).to_s + space + t("legislation.summary.votes")] - sheet.add_hyperlink :location => comment_url(comment), :ref => sheet.rows.last.cells.first + sheet.add_hyperlink location: comment_url(comment), ref: sheet.rows.last.cells.first end sheet.add_row ["", ""] end @@ -19,7 +19,7 @@ wb.add_worksheet(name: "Resume") do |sheet| Legislation::Proposal.where(legislation_process_id: @process).where(selected: true).order("cached_votes_score desc").each do |proposal| sheet.add_row [proposal.title, (proposal.cached_votes_total - proposal.cached_votes_down).to_s + space + t("legislation.summary.votes")] - sheet.add_hyperlink :location => legislation_process_proposal_url(proposal.legislation_process_id, proposal), :ref => sheet.rows.last.cells.first + sheet.add_hyperlink location: legislation_process_proposal_url(proposal.legislation_process_id, proposal), ref: sheet.rows.last.cells.first end sheet.add_row ["", ""] end @@ -30,7 +30,7 @@ wb.add_worksheet(name: "Resume") do |sheet| @process.get_best_annotation_comments.take(10).each do |comment| sheet.add_row [Legislation::Annotation.find_by(id: comment.commentable_id).quote, ""] sheet.add_row [comment.body, (comment.cached_votes_up - comment.cached_votes_down).to_s + space + t("legislation.summary.votes")] - sheet.add_hyperlink :location => comment_url(comment), :ref => sheet.rows.last.cells.first + sheet.add_hyperlink location: comment_url(comment), ref: sheet.rows.last.cells.first end end end diff --git a/db/migrate/20150820103351_create_inappropiate_flags.rb b/db/migrate/20150820103351_create_inappropiate_flags.rb index 3e69fd15c..265bfdda5 100644 --- a/db/migrate/20150820103351_create_inappropiate_flags.rb +++ b/db/migrate/20150820103351_create_inappropiate_flags.rb @@ -10,6 +10,6 @@ class CreateInappropiateFlags < ActiveRecord::Migration[4.2] end add_index :inappropiate_flags, [:flaggable_type, :flaggable_id] - add_index :inappropiate_flags, [:user_id, :flaggable_type, :flaggable_id], :name => "access_inappropiate_flags" + add_index :inappropiate_flags, [:user_id, :flaggable_type, :flaggable_id], name: "access_inappropiate_flags" end end diff --git a/db/migrate/20180924071722_add_translate_pages.rb b/db/migrate/20180924071722_add_translate_pages.rb index f29d34600..987da6eb8 100644 --- a/db/migrate/20180924071722_add_translate_pages.rb +++ b/db/migrate/20180924071722_add_translate_pages.rb @@ -9,11 +9,11 @@ class AddTranslatePages < ActiveRecord::Migration[4.2] { migrate_data: true } ) - change_column :site_customization_pages, :title, :string, :null => true + change_column :site_customization_pages, :title, :string, null: true end def self.down SiteCustomization::Page.drop_translation_table! - change_column :site_customization_pages, :title, :string, :null => false + change_column :site_customization_pages, :title, :string, null: false end end diff --git a/lib/remote_translations/microsoft/available_locales.rb b/lib/remote_translations/microsoft/available_locales.rb index 430e38b2e..17077de80 100644 --- a/lib/remote_translations/microsoft/available_locales.rb +++ b/lib/remote_translations/microsoft/available_locales.rb @@ -38,7 +38,7 @@ class RemoteTranslations::Microsoft::AvailableLocales request = Net::HTTP::Get.new(uri) request["Ocp-Apim-Subscription-Key"] = Rails.application.secrets.microsoft_api_key - response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == "https") do |http| + response = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") do |http| http.request(request) end diff --git a/spec/features/legislation/processes_spec.rb b/spec/features/legislation/processes_spec.rb index 3c06884b1..9c918f17f 100644 --- a/spec/features/legislation/processes_spec.rb +++ b/spec/features/legislation/processes_spec.rb @@ -142,7 +142,7 @@ describe "Legislation" do phases.each do |phase| within(".legislation-process-list") do - find("li", :text => "#{phase}").click_link + find("li", text: "#{phase}").click_link end expect(page).to have_content(document.title) diff --git a/spec/features/tracking/budget_investments_spec.rb b/spec/features/tracking/budget_investments_spec.rb index ddf00889e..c33c2e8e6 100644 --- a/spec/features/tracking/budget_investments_spec.rb +++ b/spec/features/tracking/budget_investments_spec.rb @@ -276,8 +276,8 @@ describe "Valuation budget investments" do expect(page).to have_content("Create progress bar") - select("Primary", :from => "Type") - fill_in("Current progress", :with => 50) + select("Primary", from: "Type") + fill_in("Current progress", with: 50) click_button "Create Progress bar" @@ -295,9 +295,9 @@ describe "Valuation budget investments" do expect(page).to have_content("Create progress bar") - select("Secondary", :from => "Type") - fill_in("Title", :with => "secondary_progress_bar") - fill_in("Current progress", :with => 50) + select("Secondary", from: "Type") + fill_in("Title", with: "secondary_progress_bar") + fill_in("Current progress", with: 50) click_button "Create Progress bar" @@ -340,7 +340,7 @@ describe "Valuation budget investments" do page.find("#progress_bar_#{secondary_progress_bar.id}").click_link("Edit") - fill_in("Title", :with => "edited") + fill_in("Title", with: "edited") click_button "Update Progress bar" expect(page).to have_content("Progress bars")