From 74088ac949f675a6eb268e6180a3b8d278a429e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 28 Mar 2019 15:03:06 +0100 Subject: [PATCH 001/104] Make random IDs with the same seed consistent The order of the array before being shuffled needs to be the same if we want to have the same array after being shuffled with a certain seed. We were using `pluck(:id)`, which doesn't guarantee the order of the elements returned. Replacing it with `order(:id).pluck(:id)` adds an `ORDER BY` clause and so guarantees the order of the elements. --- app/models/concerns/randomizable.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/concerns/randomizable.rb b/app/models/concerns/randomizable.rb index c346f1f02..98a86b426 100644 --- a/app/models/concerns/randomizable.rb +++ b/app/models/concerns/randomizable.rb @@ -3,7 +3,7 @@ module Randomizable class_methods do def sort_by_random(seed = rand(10_000_000)) - ids = pluck(:id).shuffle(random: Random.new(seed)) + ids = order(:id).pluck(:id).shuffle(random: Random.new(seed)) return all if ids.empty? From d3660d1245d014a4b1780197eb67f29d02e70dfc Mon Sep 17 00:00:00 2001 From: Bertocq Date: Mon, 4 Jun 2018 18:53:36 +0200 Subject: [PATCH 002/104] Create Budget Poll offline/online vote feature test --- spec/features/budget_polls/voter_spec.rb | 91 ++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 spec/features/budget_polls/voter_spec.rb diff --git a/spec/features/budget_polls/voter_spec.rb b/spec/features/budget_polls/voter_spec.rb new file mode 100644 index 000000000..2b887c29c --- /dev/null +++ b/spec/features/budget_polls/voter_spec.rb @@ -0,0 +1,91 @@ +require "rails_helper" + +feature "BudgetPolls", :with_frozen_time do + let(:budget) { create(:budget, :balloting) } + let(:poll) { create(:poll, :current) } + let(:booth) { create(:poll_booth) } + let(:officer) { create(:poll_officer) } + let(:admin) { create(:administrator) } + + background do + create(:poll_shift, officer: officer, booth: booth, date: Date.current, task: :vote_collection) + booth_assignment = create(:poll_booth_assignment, poll: poll, booth: booth) + create(:poll_officer_assignment, officer: officer, booth_assignment: booth_assignment, date: Date.current) + end + + context "Offline" do + scenario "A citizen can cast a paper vote", :js do + user = create(:user, :in_census) + + login_through_form_as_officer(officer.user) + + visit new_officing_residence_path + officing_verify_residence + + expect(page).to have_content poll.name + + within("#poll_#{poll.id}") do + click_button("Confirm vote") + expect(page).not_to have_button("Confirm vote") + expect(page).to have_content "Vote introduced!" + end + + expect(Poll::Voter.count).to eq(1) + expect(Poll::Voter.first.origin).to eq("booth") + + visit root_path + click_link "Sign out" + login_as(admin.user) + visit admin_poll_recounts_path(poll) + + within("#total_system") do + expect(page).to have_content "1" + end + + within("#poll_booth_assignment_#{Poll::BoothAssignment.where(poll: poll, booth: booth).first.id}_recounts") do + expect(page).to have_content "1" + end + end + + scenario "A citizen cannot vote offline again", :js do + user = create(:user, :in_census) + + login_through_form_as_officer(officer.user) + + visit new_officing_residence_path + officing_verify_residence + + within("#poll_#{poll.id}") do + click_button("Confirm vote") + end + + visit new_officing_residence_path + officing_verify_residence + + within("#poll_#{poll.id}") do + expect(page).to have_content "Has already participated in this poll" + end + end + + scenario "A citizen cannot vote online after voting offline" do + # create scenario for an user that voted offline + + # Check the citizen cannot vote online + end + end + + context "Online" do + scenario "A citizen can cast vote online" do + # Login as User + # Cast a vote for an investment + end + + scenario "A citizen cannot vote offline after voting online" do + # create scenario for an user that voted online + + # Login as Poll Officer + # Check the citizen cannot vote offline + end + + end +end From 20a3f6539dbaa6cb2fc54f84ebb5ea28255a8f78 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Mon, 4 Jun 2018 20:00:09 +0200 Subject: [PATCH 003/104] Add association between polls and budgets --- app/models/budget.rb | 2 ++ app/models/poll.rb | 1 + db/migrate/20180604173248_add_budget_to_polls.rb | 5 +++++ db/schema.rb | 3 +++ 4 files changed, 11 insertions(+) create mode 100644 db/migrate/20180604173248_add_budget_to_polls.rb diff --git a/app/models/budget.rb b/app/models/budget.rb index ecfacc5c0..28fb8c5ca 100644 --- a/app/models/budget.rb +++ b/app/models/budget.rb @@ -21,6 +21,8 @@ class Budget < ActiveRecord::Base has_many :headings, through: :groups has_many :phases, class_name: Budget::Phase + has_one :poll + before_validation :sanitize_descriptions after_create :generate_phases diff --git a/app/models/poll.rb b/app/models/poll.rb index 9276cf9fb..9b300c150 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -23,6 +23,7 @@ class Poll < ActiveRecord::Base has_and_belongs_to_many :geozones belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id" + belongs_to :budget validates_translation :name, presence: true validate :date_range diff --git a/db/migrate/20180604173248_add_budget_to_polls.rb b/db/migrate/20180604173248_add_budget_to_polls.rb new file mode 100644 index 000000000..74d45e1a8 --- /dev/null +++ b/db/migrate/20180604173248_add_budget_to_polls.rb @@ -0,0 +1,5 @@ +class AddBudgetToPolls < ActiveRecord::Migration + def change + add_reference :polls, :budget, index: { unique: true }, foreign_key: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 991f6d327..96e3d3487 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1129,8 +1129,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.boolean "stats_enabled", default: false t.datetime "created_at" t.datetime "updated_at" + t.integer "budget_id" end + add_index "polls", ["budget_id"], name: "index_polls_on_budget_id", unique: true, using: :btree add_index "polls", ["starts_at", "ends_at"], name: "index_polls_on_starts_at_and_ends_at", using: :btree create_table "progress_bar_translations", force: :cascade do |t| @@ -1614,6 +1616,7 @@ ActiveRecord::Schema.define(version: 20190205131722) do add_foreign_key "poll_recounts", "poll_booth_assignments", column: "booth_assignment_id" add_foreign_key "poll_recounts", "poll_officer_assignments", column: "officer_assignment_id" add_foreign_key "poll_voters", "polls" + add_foreign_key "polls", "budgets" add_foreign_key "proposals", "communities" add_foreign_key "related_content_scores", "related_contents" add_foreign_key "related_content_scores", "users" From aa7441271d86418c2c2314abcd4c1aee6354a106 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Mon, 4 Jun 2018 20:02:00 +0200 Subject: [PATCH 004/104] Prevent balloting online after casting a ballot offline --- app/models/budget/ballot.rb | 4 ++++ app/models/budget/investment.rb | 1 + config/locales/en/budgets.yml | 1 + config/locales/es/budgets.yml | 1 + spec/features/budget_polls/voter_spec.rb | 30 ++++++++++++++++++++---- 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/app/models/budget/ballot.rb b/app/models/budget/ballot.rb index c35222f3a..7dc618360 100644 --- a/app/models/budget/ballot.rb +++ b/app/models/budget/ballot.rb @@ -70,5 +70,9 @@ class Budget investments.where(group: group).first.heading end + def casted_offline? + budget.poll&.voted_by?(user) + end + end end diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 4dae6c3ac..fa95de72e 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -241,6 +241,7 @@ class Budget return :no_ballots_allowed unless budget.balloting? return :different_heading_assigned_html unless ballot.valid_heading?(heading) return :not_enough_money_html if ballot.present? && !enough_money?(ballot) + return :casted_offline if ballot.casted_offline? end def permission_problem(user) diff --git a/config/locales/en/budgets.yml b/config/locales/en/budgets.yml index 3fd88cd48..d7bd7235d 100644 --- a/config/locales/en/budgets.yml +++ b/config/locales/en/budgets.yml @@ -22,6 +22,7 @@ en: no_ballots_allowed: Selecting phase is closed different_heading_assigned_html: "You have already voted a different heading: %{heading_link}" change_ballot: change your votes + casted_offline: You have already participated offline groups: show: title: Select an option diff --git a/config/locales/es/budgets.yml b/config/locales/es/budgets.yml index c827b2349..982149b5a 100644 --- a/config/locales/es/budgets.yml +++ b/config/locales/es/budgets.yml @@ -22,6 +22,7 @@ es: no_ballots_allowed: El periodo de votación está cerrado. different_heading_assigned_html: "Ya has votado proyectos de otra partida: %{heading_link}" change_ballot: cambiar tus votos + casted_offline: Ya has participado presencialmente groups: show: title: Selecciona una opción diff --git a/spec/features/budget_polls/voter_spec.rb b/spec/features/budget_polls/voter_spec.rb index 2b887c29c..8808177f4 100644 --- a/spec/features/budget_polls/voter_spec.rb +++ b/spec/features/budget_polls/voter_spec.rb @@ -2,7 +2,10 @@ require "rails_helper" feature "BudgetPolls", :with_frozen_time do let(:budget) { create(:budget, :balloting) } - let(:poll) { create(:poll, :current) } + let(:group) { create(:budget_group, budget: budget) } + let(:heading) { create(:budget_heading, group: group) } + let(:investment) { create(:budget_investment, :selected, heading: heading) } + let(:poll) { create(:poll, :current, budget: budget) } let(:booth) { create(:poll_booth) } let(:officer) { create(:poll_officer) } let(:admin) { create(:administrator) } @@ -67,10 +70,29 @@ feature "BudgetPolls", :with_frozen_time do end end - scenario "A citizen cannot vote online after voting offline" do - # create scenario for an user that voted offline + scenario "A citizen cannot vote online after voting offline", :js do + user = create(:user, :in_census) - # Check the citizen cannot vote online + login_through_form_as_officer(officer.user) + + visit new_officing_residence_path + officing_verify_residence + + within("#poll_#{poll.id}") do + click_button("Confirm vote") + end + + expect(page).to have_content "Vote introduced!" + + login_as(user) + + visit budget_investment_path(budget, investment) + find("div.ballot").hover + + within("#budget_investment_#{investment.id}") do + expect(page).to have_content "You have already participated offline" + expect(page).to have_css(".add a", visible: false) + end end end From dac0264b63934aee4ded8ca44787dc02dec8fd49 Mon Sep 17 00:00:00 2001 From: Bertocq Date: Mon, 4 Jun 2018 21:08:43 +0200 Subject: [PATCH 005/104] Prevent offline budget vote after voting online --- app/models/poll.rb | 5 ++ spec/features/budget_polls/voter_spec.rb | 59 ++++++++++++++++++------ 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/app/models/poll.rb b/app/models/poll.rb index 9b300c150..7b04f45ec 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -72,10 +72,15 @@ class Poll < ActiveRecord::Base end def votable_by?(user) + return false if user_has_an_online_ballot(user) answerable_by?(user) && not_voted_by?(user) end + def user_has_an_online_ballot(user) + budget.present? && budget.ballots.find_by(user: user)&.lines.present? + end + def self.not_voted_by(user) where("polls.id not in (?)", poll_ids_voted_by(user)) end diff --git a/spec/features/budget_polls/voter_spec.rb b/spec/features/budget_polls/voter_spec.rb index 8808177f4..6462f021d 100644 --- a/spec/features/budget_polls/voter_spec.rb +++ b/spec/features/budget_polls/voter_spec.rb @@ -9,6 +9,7 @@ feature "BudgetPolls", :with_frozen_time do let(:booth) { create(:poll_booth) } let(:officer) { create(:poll_officer) } let(:admin) { create(:administrator) } + let!(:user) { create(:user, :in_census) } background do create(:poll_shift, officer: officer, booth: booth, date: Date.current, task: :vote_collection) @@ -18,8 +19,6 @@ feature "BudgetPolls", :with_frozen_time do context "Offline" do scenario "A citizen can cast a paper vote", :js do - user = create(:user, :in_census) - login_through_form_as_officer(officer.user) visit new_officing_residence_path @@ -51,8 +50,6 @@ feature "BudgetPolls", :with_frozen_time do end scenario "A citizen cannot vote offline again", :js do - user = create(:user, :in_census) - login_through_form_as_officer(officer.user) visit new_officing_residence_path @@ -71,8 +68,6 @@ feature "BudgetPolls", :with_frozen_time do end scenario "A citizen cannot vote online after voting offline", :js do - user = create(:user, :in_census) - login_through_form_as_officer(officer.user) visit new_officing_residence_path @@ -97,16 +92,54 @@ feature "BudgetPolls", :with_frozen_time do end context "Online" do - scenario "A citizen can cast vote online" do - # Login as User - # Cast a vote for an investment + scenario "A citizen can cast vote online", :js do + login_as(user) + visit budget_investment_path(budget, investment) + + within("#budget_investment_#{investment.id}") do + find(".add a").click + expect(page).to have_content "Remove" + end end - scenario "A citizen cannot vote offline after voting online" do - # create scenario for an user that voted online + scenario "A citizen cannot vote online again", :js do + login_as(user) + visit budget_investment_path(budget, investment) - # Login as Poll Officer - # Check the citizen cannot vote offline + within("#budget_investment_#{investment.id}") do + find(".add a").click + expect(page).to have_content "Remove" + end + + visit budget_investment_path(budget, investment) + find("div.ballot").hover + + within("#budget_investment_#{investment.id}") do + expect(page).to have_content "Remove vote" + end + end + + scenario "A citizen cannot vote offline after voting online", :js do + login_as(user) + visit budget_investment_path(budget, investment) + + within("#budget_investment_#{investment.id}") do + find(".add a").click + expect(page).to have_content "Remove" + end + + logout + login_through_form_as_officer(officer.user) + + visit new_officing_residence_path + officing_verify_residence + + expect(page).to have_content poll.name + + within("#poll_#{poll.id}") do + expect(page).not_to have_button("Confirm vote") + expect(page).to have_content("Has already participated in this poll") + end end end From 7dd314c699e6bce8dfc0f249f1ed51032f47adfb Mon Sep 17 00:00:00 2001 From: rgarcia Date: Thu, 7 Jun 2018 13:07:52 +0200 Subject: [PATCH 006/104] Do not display polls associated to a budget in admin poll questions This section is used to select to which poll a question belongs to. Budget polls are not meant to include questions that come from Citizen Proposals or Government Questions, thus we do not display them --- .../admin/poll/questions_controller.rb | 2 +- app/models/poll.rb | 1 + spec/features/budget_polls/questions_spec.rb | 22 +++++++++++++++++++ spec/models/poll/poll_spec.rb | 20 +++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 spec/features/budget_polls/questions_spec.rb diff --git a/app/controllers/admin/poll/questions_controller.rb b/app/controllers/admin/poll/questions_controller.rb index ed39862b2..769a7998c 100644 --- a/app/controllers/admin/poll/questions_controller.rb +++ b/app/controllers/admin/poll/questions_controller.rb @@ -6,7 +6,7 @@ class Admin::Poll::QuestionsController < Admin::Poll::BaseController load_and_authorize_resource :question, class: "Poll::Question" def index - @polls = Poll.all + @polls = Poll.not_budget @search = search_params[:search] @questions = @questions.search(search_params).page(params[:page]).order("created_at DESC") diff --git a/app/models/poll.rb b/app/models/poll.rb index 7b04f45ec..9d706b020 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -34,6 +34,7 @@ class Poll < ActiveRecord::Base scope :published, -> { where("published = ?", true) } scope :by_geozone_id, ->(geozone_id) { where(geozones: {id: geozone_id}.joins(:geozones)) } scope :public_for_api, -> { all } + scope :not_budget, -> { where(budget_id: nil) } scope :sort_for_list, -> { order(:geozone_restricted, :starts_at, :name) } diff --git a/spec/features/budget_polls/questions_spec.rb b/spec/features/budget_polls/questions_spec.rb new file mode 100644 index 000000000..5e320573b --- /dev/null +++ b/spec/features/budget_polls/questions_spec.rb @@ -0,0 +1,22 @@ +require "rails_helper" + +feature "Poll Questions" do + + before do + admin = create(:administrator).user + login_as(admin) + end + + scenario "Do not display polls associated to a budget" do + budget = create(:budget) + + poll1 = create(:poll, name: "Citizen Proposal Poll") + poll2 = create(:poll, budget: budget, name: "Participatory Budget Poll") + + visit admin_questions_path + + expect(page).to have_select("poll_id", text: "Citizen Proposal Poll") + expect(page).not_to have_select("poll_id", text: "Participatory Budget Poll") + end + +end diff --git a/spec/models/poll/poll_spec.rb b/spec/models/poll/poll_spec.rb index ced234dd7..85f9e5877 100644 --- a/spec/models/poll/poll_spec.rb +++ b/spec/models/poll/poll_spec.rb @@ -258,4 +258,24 @@ describe Poll do end + context "scopes" do + + describe "#not_budget" do + + it "returns polls not associated to a budget" do + budget = create(:budget) + + poll1 = create(:poll) + poll2 = create(:poll) + poll3 = create(:poll, budget: budget) + + expect(Poll.not_budget).to include(poll1) + expect(Poll.not_budget).to include(poll2) + expect(Poll.not_budget).not_to include(poll3) + end + + end + + end + end From f6739dc7e5e9a42087755dbce7b80d1d18daec54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Thu, 7 Jun 2018 18:31:57 +0200 Subject: [PATCH 007/104] Adds "Admin ballots" button in admin budgets index --- app/views/admin/budgets/index.html.erb | 6 ++++++ config/locales/en/admin.yml | 2 ++ config/locales/es/admin.yml | 2 ++ spec/features/admin/budgets_spec.rb | 10 ++++++++++ 4 files changed, 20 insertions(+) diff --git a/app/views/admin/budgets/index.html.erb b/app/views/admin/budgets/index.html.erb index 2be3ae926..eb676842e 100644 --- a/app/views/admin/budgets/index.html.erb +++ b/app/views/admin/budgets/index.html.erb @@ -17,6 +17,7 @@ <%= t("admin.budgets.index.table_investments") %> <%= t("admin.budgets.index.table_edit_groups") %> <%= t("admin.budgets.index.table_edit_budget") %> + <%= t("admin.budgets.index.table_admin_ballots") %> @@ -39,6 +40,11 @@ <%= link_to t("admin.budgets.index.edit_budget"), edit_admin_budget_path(budget) %> + + <% if budget.poll.present? %> + <%= link_to t("admin.budgets.index.admin_ballots"), admin_poll_path(budget.poll) %> + <% end %> + <% end %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 78584d535..5e8f21efe 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -85,8 +85,10 @@ en: table_investments: Investments table_edit_groups: Headings groups table_edit_budget: Edit + table_admin_ballots: Ballots edit_groups: Edit headings groups edit_budget: Edit budget + admin_ballots: Admin ballots no_budgets: "There are no budgets." create: notice: New participatory budget created successfully! diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index 5cacec041..8afc248bc 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -85,8 +85,10 @@ es: table_investments: Proyectos de gasto table_edit_groups: Grupos de partidas table_edit_budget: Editar + table_admin_ballots: Urnas edit_groups: Editar grupos de partidas edit_budget: Editar presupuesto + admin_ballots: Gestionar urnas no_budgets: "No hay presupuestos participativos." create: notice: "¡Presupuestos participativos creados con éxito!" diff --git a/spec/features/admin/budgets_spec.rb b/spec/features/admin/budgets_spec.rb index e24c344b2..83c9006e7 100644 --- a/spec/features/admin/budgets_spec.rb +++ b/spec/features/admin/budgets_spec.rb @@ -88,6 +88,16 @@ feature "Admin budgets" do end end + scenario "Admin ballots link appears if budget has a poll associated" do + budget = create(:budget) + create(:poll, budget: budget) + + visit admin_budgets_path + + within "#budget_#{budget.id}" do + expect(page).to have_link("Admin ballots") + end + end end context "New" do From acb0a6070ecd35ffee6cf25dbcf9c0113f25db61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Fri, 8 Jun 2018 14:58:47 +0200 Subject: [PATCH 008/104] Hides budget polls in polls admin index --- .../admin/poll/polls_controller.rb | 2 +- spec/features/budget_polls/polls_spec.rb | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 spec/features/budget_polls/polls_spec.rb diff --git a/app/controllers/admin/poll/polls_controller.rb b/app/controllers/admin/poll/polls_controller.rb index b012aad38..ab8ddaaa2 100644 --- a/app/controllers/admin/poll/polls_controller.rb +++ b/app/controllers/admin/poll/polls_controller.rb @@ -7,7 +7,7 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController before_action :load_geozones, only: [:new, :create, :edit, :update] def index - @polls = Poll.order(starts_at: :desc) + @polls = Poll.not_budget.order(starts_at: :desc) end def show diff --git a/spec/features/budget_polls/polls_spec.rb b/spec/features/budget_polls/polls_spec.rb new file mode 100644 index 000000000..24a3eb15a --- /dev/null +++ b/spec/features/budget_polls/polls_spec.rb @@ -0,0 +1,19 @@ +require "rails_helper" + +feature "Polls" do + + context "Admin index" do + it "Budget polls should not appear in the list" do + login_as(create(:administrator).user) + + poll = create(:poll) + budget_poll = create(:poll, budget: create(:budget)) + + visit admin_polls_path + + expect(page).to have_content(poll.name) + expect(page).not_to have_content(budget_poll.name) + end + end + +end From 22727a987675053a7997023a617e4202cff507c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20Checa?= Date: Fri, 8 Jun 2018 14:59:07 +0200 Subject: [PATCH 009/104] Hides budget polls in polls public index --- app/controllers/polls_controller.rb | 2 +- spec/features/budget_polls/polls_spec.rb | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index a034846a0..652a9eaae 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -11,7 +11,7 @@ class PollsController < ApplicationController ::Poll::Answer # trigger autoload def index - @polls = @polls.send(@current_filter).includes(:geozones).sort_for_list.page(params[:page]) + @polls = @polls.not_budget.send(@current_filter).includes(:geozones).sort_for_list.page(params[:page]) end def show diff --git a/spec/features/budget_polls/polls_spec.rb b/spec/features/budget_polls/polls_spec.rb index 24a3eb15a..35e2b1b0f 100644 --- a/spec/features/budget_polls/polls_spec.rb +++ b/spec/features/budget_polls/polls_spec.rb @@ -2,6 +2,18 @@ require "rails_helper" feature "Polls" do + context "Public index" do + it "Budget polls should not be listed" do + poll = create(:poll) + budget_poll = create(:poll, budget: create(:budget)) + + visit polls_path + + expect(page).to have_content(poll.name) + expect(page).not_to have_content(budget_poll.name) + end + end + context "Admin index" do it "Budget polls should not appear in the list" do login_as(create(:administrator).user) From b1b88918f0e0671975325e2879decadbf3cc97e6 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Mon, 11 Jun 2018 19:17:59 +0200 Subject: [PATCH 010/104] Moving spec to budget_polls folder --- spec/features/admin/budgets_spec.rb | 10 ---------- spec/features/budget_polls/budgets_spec.rb | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 10 deletions(-) create mode 100644 spec/features/budget_polls/budgets_spec.rb diff --git a/spec/features/admin/budgets_spec.rb b/spec/features/admin/budgets_spec.rb index 83c9006e7..e24c344b2 100644 --- a/spec/features/admin/budgets_spec.rb +++ b/spec/features/admin/budgets_spec.rb @@ -88,16 +88,6 @@ feature "Admin budgets" do end end - scenario "Admin ballots link appears if budget has a poll associated" do - budget = create(:budget) - create(:poll, budget: budget) - - visit admin_budgets_path - - within "#budget_#{budget.id}" do - expect(page).to have_link("Admin ballots") - end - end end context "New" do diff --git a/spec/features/budget_polls/budgets_spec.rb b/spec/features/budget_polls/budgets_spec.rb new file mode 100644 index 000000000..fc1b8939a --- /dev/null +++ b/spec/features/budget_polls/budgets_spec.rb @@ -0,0 +1,21 @@ +require "rails_helper" + +feature "Admin Budgets" do + + background do + admin = create(:administrator).user + login_as(admin) + end + + scenario "Admin ballots link appears if budget has a poll associated" do + budget = create(:budget) + create(:poll, budget: budget) + + visit admin_budgets_path + + within "#budget_#{budget.id}" do + expect(page).to have_link("Admin ballots") + end + end + +end From 8cfcfcb6a796f5c86676dc5c82ba9d516bdc22da Mon Sep 17 00:00:00 2001 From: rgarcia Date: Mon, 11 Jun 2018 19:19:06 +0200 Subject: [PATCH 011/104] Check for link to poll in specs --- spec/features/budget_polls/budgets_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/features/budget_polls/budgets_spec.rb b/spec/features/budget_polls/budgets_spec.rb index fc1b8939a..d62c07667 100644 --- a/spec/features/budget_polls/budgets_spec.rb +++ b/spec/features/budget_polls/budgets_spec.rb @@ -9,12 +9,12 @@ feature "Admin Budgets" do scenario "Admin ballots link appears if budget has a poll associated" do budget = create(:budget) - create(:poll, budget: budget) + poll = create(:poll, budget: budget) visit admin_budgets_path within "#budget_#{budget.id}" do - expect(page).to have_link("Admin ballots") + expect(page).to have_link("Admin ballots", admin_poll_path(poll)) end end From 6fa75621814af1e12afbd529ccb9c3635c54abfe Mon Sep 17 00:00:00 2001 From: rgarcia Date: Tue, 12 Jun 2018 13:41:03 +0200 Subject: [PATCH 012/104] Automatically create a budget poll if it does not exist --- .../admin/poll/polls_controller.rb | 2 +- app/helpers/budgets_helper.rb | 12 +++++++ app/views/admin/budgets/index.html.erb | 2 ++ spec/features/budget_polls/budgets_spec.rb | 34 +++++++++++++++---- 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/app/controllers/admin/poll/polls_controller.rb b/app/controllers/admin/poll/polls_controller.rb index ab8ddaaa2..5b0d3108e 100644 --- a/app/controllers/admin/poll/polls_controller.rb +++ b/app/controllers/admin/poll/polls_controller.rb @@ -63,7 +63,7 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController def poll_params attributes = [:name, :starts_at, :ends_at, :geozone_restricted, :results_enabled, - :stats_enabled, geozone_ids: [], + :stats_enabled, :budget_id, geozone_ids: [], image_attributes: image_attributes] params.require(:poll).permit(*attributes, translation_params(Poll)) end diff --git a/app/helpers/budgets_helper.rb b/app/helpers/budgets_helper.rb index df48a08fa..e4a47557b 100644 --- a/app/helpers/budgets_helper.rb +++ b/app/helpers/budgets_helper.rb @@ -96,4 +96,16 @@ module BudgetsHelper !current_user.voted_in_group?(investment.group) && investment.group.headings.count > 1 end + + def link_to_create_budget_poll(budget) + balloting_phase = budget.phases.where(kind: "balloting").first + + link_to t("admin.budgets.index.admin_ballots"), + admin_polls_path(poll: { + name: budget.name, + budget_id: budget.id, + starts_at: balloting_phase.starts_at, + ends_at: balloting_phase.ends_at }), + method: :post + end end diff --git a/app/views/admin/budgets/index.html.erb b/app/views/admin/budgets/index.html.erb index eb676842e..31388ce3c 100644 --- a/app/views/admin/budgets/index.html.erb +++ b/app/views/admin/budgets/index.html.erb @@ -43,6 +43,8 @@ <% if budget.poll.present? %> <%= link_to t("admin.budgets.index.admin_ballots"), admin_poll_path(budget.poll) %> + <% else %> + <%= link_to_create_budget_poll(budget) %> <% end %> diff --git a/spec/features/budget_polls/budgets_spec.rb b/spec/features/budget_polls/budgets_spec.rb index d62c07667..e85ad4b90 100644 --- a/spec/features/budget_polls/budgets_spec.rb +++ b/spec/features/budget_polls/budgets_spec.rb @@ -7,15 +7,37 @@ feature "Admin Budgets" do login_as(admin) end - scenario "Admin ballots link appears if budget has a poll associated" do - budget = create(:budget) - poll = create(:poll, budget: budget) + context "Index" do - visit admin_budgets_path + scenario "Create poll if the budget does not have a poll associated" do + budget = create(:budget) - within "#budget_#{budget.id}" do - expect(page).to have_link("Admin ballots", admin_poll_path(poll)) + visit admin_budgets_path + + click_link "Admin ballots" + + balloting_phase = budget.phases.where(kind: "balloting").first + + expect(current_path).to match(/admin\/polls\/\d+/) + expect(page).to have_content(budget.name) + expect(page).to have_content(balloting_phase.starts_at.to_date) + expect(page).to have_content(balloting_phase.ends_at.to_date) + + expect(Poll.count).to eq(1) + expect(Poll.last.budget).to eq(budget) end + + scenario "Display link to poll if the budget has a poll associated" do + budget = create(:budget) + poll = create(:poll, budget: budget) + + visit admin_budgets_path + + within "#budget_#{budget.id}" do + expect(page).to have_link("Admin ballots", admin_poll_path(poll)) + end + end + end end From 431c313487aa8cefb27472818cac29a93a931df9 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Tue, 12 Jun 2018 13:41:43 +0200 Subject: [PATCH 013/104] Use `scenario` instead of `it` in feature specs --- spec/features/budget_polls/polls_spec.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spec/features/budget_polls/polls_spec.rb b/spec/features/budget_polls/polls_spec.rb index 35e2b1b0f..d9ae151cf 100644 --- a/spec/features/budget_polls/polls_spec.rb +++ b/spec/features/budget_polls/polls_spec.rb @@ -3,7 +3,8 @@ require "rails_helper" feature "Polls" do context "Public index" do - it "Budget polls should not be listed" do + + scenario "Budget polls should not be listed" do poll = create(:poll) budget_poll = create(:poll, budget: create(:budget)) @@ -12,10 +13,12 @@ feature "Polls" do expect(page).to have_content(poll.name) expect(page).not_to have_content(budget_poll.name) end + end context "Admin index" do - it "Budget polls should not appear in the list" do + + scenario "Budget polls should not appear in the list" do login_as(create(:administrator).user) poll = create(:poll) From fcbb11b26ec2d938fe96b00ecbef9728ebb5acc3 Mon Sep 17 00:00:00 2001 From: decabeza Date: Wed, 13 Jun 2018 15:35:29 +0200 Subject: [PATCH 014/104] Hides question menu on budget poll and changes redirect when create --- .../admin/poll/polls_controller.rb | 7 ++++- app/models/poll.rb | 3 ++ app/views/admin/budgets/index.html.erb | 2 +- app/views/admin/poll/polls/_subnav.html.erb | 30 ++++++++++--------- 4 files changed, 26 insertions(+), 16 deletions(-) diff --git a/app/controllers/admin/poll/polls_controller.rb b/app/controllers/admin/poll/polls_controller.rb index 5b0d3108e..04a94cce3 100644 --- a/app/controllers/admin/poll/polls_controller.rb +++ b/app/controllers/admin/poll/polls_controller.rb @@ -22,7 +22,12 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController def create @poll = Poll.new(poll_params.merge(author: current_user)) if @poll.save - redirect_to [:admin, @poll], notice: t("flash.actions.create.poll") + notice = t("flash.actions.create.poll") + if @poll.budget.present? + redirect_to admin_poll_booth_assignments_path(@poll), notice: notice + else + redirect_to [:admin, @poll], notice: notice + end else render :new end diff --git a/app/models/poll.rb b/app/models/poll.rb index 9d706b020..553baf036 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -114,4 +114,7 @@ class Poll < ActiveRecord::Base end end + def budget_poll? + budget.present? + end end diff --git a/app/views/admin/budgets/index.html.erb b/app/views/admin/budgets/index.html.erb index 31388ce3c..c63ee4789 100644 --- a/app/views/admin/budgets/index.html.erb +++ b/app/views/admin/budgets/index.html.erb @@ -42,7 +42,7 @@ <% if budget.poll.present? %> - <%= link_to t("admin.budgets.index.admin_ballots"), admin_poll_path(budget.poll) %> + <%= link_to t("admin.budgets.index.admin_ballots"), admin_poll_booth_assignments_path(budget.poll) %> <% else %> <%= link_to_create_budget_poll(budget) %> <% end %> diff --git a/app/views/admin/poll/polls/_subnav.html.erb b/app/views/admin/poll/polls/_subnav.html.erb index 98e23003b..f72176a9e 100644 --- a/app/views/admin/poll/polls/_subnav.html.erb +++ b/app/views/admin/poll/polls/_subnav.html.erb @@ -1,18 +1,20 @@ From 930fc58173db4aa8f15b90813b2892c245fe452e Mon Sep 17 00:00:00 2001 From: rgarcia Date: Mon, 24 Oct 2016 03:09:49 +0200 Subject: [PATCH 056/104] fixes lock specs --- app/models/lock.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/lock.rb b/app/models/lock.rb index c0d5fae39..57d437884 100644 --- a/app/models/lock.rb +++ b/app/models/lock.rb @@ -21,7 +21,7 @@ class Lock < ActiveRecord::Base end def self.increase_tries(user) - Lock.find_or_create_by(user: user).increment!(:tries) + Lock.find_or_create_by(user: user).increment!(:tries).save end def self.max_tries From b7a9995b386545158e6882fbed774a8bcad5c411 Mon Sep 17 00:00:00 2001 From: alejandro Date: Tue, 2 May 2017 14:40:44 +0200 Subject: [PATCH 057/104] fixes deprecation warning relate to raise_in_transactional_callbacks As described in http://edgeguides.rubyonrails.org/5_0_release_notes.html#active-record-notable-changes --- config/application.rb | 3 --- 1 file changed, 3 deletions(-) diff --git a/config/application.rb b/config/application.rb index 828296bb8..f4345061a 100644 --- a/config/application.rb +++ b/config/application.rb @@ -55,9 +55,6 @@ module Consul config.assets.paths << Rails.root.join("app", "assets", "fonts") - # Do not swallow errors in after_commit/after_rollback callbacks. - config.active_record.raise_in_transactional_callbacks = true - # Add lib to the autoload path config.autoload_paths << Rails.root.join("lib") config.time_zone = "Madrid" From f668317cc14b6a73a086a5ad2432169ff853e24d Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Sat, 23 Mar 2019 12:49:59 +0100 Subject: [PATCH 058/104] Use #data_source_exists? instead of #table_exists? DEPRECATION WARNING: #table_exists? currently checks both tables and views. This behavior is deprecated and will be changed with Rails 5.1 to only check tables. Use #data_source_exists? instead. --- config/initializers/devise.rb | 2 +- db/migrate/20150822095305_create_verified_users.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 7bff2d029..97fa34288 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -12,7 +12,7 @@ Devise.setup do |config| # Configure the e-mail address which will be shown in Devise::Mailer, # note that it will be overwritten if you use your own mailer class # with default "from" parameter. - if Rails.env.test? || !ActiveRecord::Base.connection.table_exists?("settings") + if Rails.env.test? || !ActiveRecord::Base.connection.data_source_exists?("settings") config.mailer_sender = "noreply@consul.dev" else config.mailer_sender = "'#{Setting["mailer_from_name"]}' <#{Setting["mailer_from_address"]}>" diff --git a/db/migrate/20150822095305_create_verified_users.rb b/db/migrate/20150822095305_create_verified_users.rb index bb0c54042..457ba6b89 100644 --- a/db/migrate/20150822095305_create_verified_users.rb +++ b/db/migrate/20150822095305_create_verified_users.rb @@ -1,6 +1,6 @@ class CreateVerifiedUsers < ActiveRecord::Migration def change - unless ActiveRecord::Base.connection.table_exists? 'verified_users' + unless ActiveRecord::Base.connection.data_source_exists?("verified_users") create_table :verified_users do |t| t.string :document_number t.string :document_type From b2b418284d1abcfb590767923dfac4028275d2db Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sun, 8 Apr 2018 14:45:29 +0200 Subject: [PATCH 059/104] Fix ActiveModel::Errors#[]= deprecation warning DEPRECATION WARNING: ActiveModel::Errors#[]= is deprecated and will be removed in Rails 5.1. Use model.errors.add(:attachment, "content type image/png does not match any of accepted content types pdf") instead. (called from validate_attachment_content_type at /home/travis/build/consul/consul/app/models/document.rb:92) --- app/models/direct_upload.rb | 2 +- app/models/document.rb | 12 ++++++------ app/models/image.rb | 14 +++++++------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/models/direct_upload.rb b/app/models/direct_upload.rb index c4d1456e7..088c8ea64 100644 --- a/app/models/direct_upload.rb +++ b/app/models/direct_upload.rb @@ -51,7 +51,7 @@ class DirectUpload @relation.valid? if @relation.errors.key? :attachment - errors[:attachment] = @relation.errors[:attachment] + errors.add(:attachment, @relation.errors.full_messages_for(:attachment)) end end diff --git a/app/models/document.rb b/app/models/document.rb index 108f29fad..e8524bc72 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -80,24 +80,24 @@ class Document < ActiveRecord::Base def validate_attachment_size if documentable_class.present? && attachment_file_size > documentable_class.max_file_size - errors[:attachment] = I18n.t("documents.errors.messages.in_between", + errors.add(:attachment, I18n.t("documents.errors.messages.in_between", min: "0 Bytes", - max: "#{max_file_size(documentable_class)} MB") + max: "#{max_file_size(documentable_class)} MB")) end end def validate_attachment_content_type if documentable_class && !accepted_content_types(documentable_class).include?(attachment_content_type) - errors[:attachment] = I18n.t("documents.errors.messages.wrong_content_type", - content_type: attachment_content_type, - accepted_content_types: documentable_humanized_accepted_content_types(documentable_class)) + errors.add(:attachment, I18n.t("documents.errors.messages.wrong_content_type", + content_type: attachment_content_type, + accepted_content_types: documentable_humanized_accepted_content_types(documentable_class))) end end def attachment_presence if attachment.blank? && cached_attachment.blank? - errors[:attachment] = I18n.t("errors.messages.blank") + errors.add(:attachment, I18n.t("errors.messages.blank")) end end diff --git a/app/models/image.rb b/app/models/image.rb index 8f62f94d8..a782d1916 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -79,23 +79,23 @@ class Image < ActiveRecord::Base def validate_attachment_size if imageable_class && attachment_file_size > 1.megabytes - errors[:attachment] = I18n.t("images.errors.messages.in_between", - min: "0 Bytes", - max: "#{imageable_max_file_size} MB") + errors.add(:attachment, I18n.t("images.errors.messages.in_between", + min: "0 Bytes", + max: "#{imageable_max_file_size} MB")) end end def validate_attachment_content_type if imageable_class && !attachment_of_valid_content_type? - errors[:attachment] = I18n.t("images.errors.messages.wrong_content_type", - content_type: attachment_content_type, - accepted_content_types: imageable_humanized_accepted_content_types) + errors.add(:attachment, I18n.t("images.errors.messages.wrong_content_type", + content_type: attachment_content_type, + accepted_content_types: imageable_humanized_accepted_content_types)) end end def attachment_presence if attachment.blank? && cached_attachment.blank? - errors[:attachment] = I18n.t("errors.messages.blank") + errors.add(:attachment, I18n.t("errors.messages.blank")) end end From c6ab5dbe1b68c4134c9d34c680d949642a9bd66e Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sun, 8 Apr 2018 13:59:00 +0200 Subject: [PATCH 060/104] Remove before_filter deprecation warning DEPRECATION WARNING: before_filter is deprecated and will be removed in Rails 5.1. Use before_action instead. (called from at /home/travis/build/consul/consul/app/controllers/users/registrations_con troller.rb:3) --- app/controllers/users/registrations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 970ed8cba..0270b36c7 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -1,6 +1,6 @@ class Users::RegistrationsController < Devise::RegistrationsController prepend_before_action :authenticate_scope!, only: [:edit, :update, :destroy, :finish_signup, :do_finish_signup] - before_filter :configure_permitted_parameters + before_action :configure_permitted_parameters invisible_captcha only: [:create], honeypot: :address, scope: :user From f23fd6f3bbd99ada5a10667a966c853f91f1cdcf Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sun, 8 Apr 2018 13:43:22 +0200 Subject: [PATCH 061/104] Remove parameterise deprecation warning DEPRECATION WARNING: Passing the separator argument as a positional parameter is deprecated and will soon be removed. Use `separator: '_'` instead. --- app/controllers/admin/budget_investments_controller.rb | 2 +- app/controllers/valuation/budget_investments_controller.rb | 2 +- app/helpers/documentables_helper.rb | 2 +- app/helpers/followables_helper.rb | 2 +- app/helpers/imageables_helper.rb | 2 +- spec/models/concerns/sluggable.rb | 2 +- spec/shared/features/relationable.rb | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/controllers/admin/budget_investments_controller.rb b/app/controllers/admin/budget_investments_controller.rb index b83189ccd..156d74f34 100644 --- a/app/controllers/admin/budget_investments_controller.rb +++ b/app/controllers/admin/budget_investments_controller.rb @@ -69,7 +69,7 @@ class Admin::BudgetInvestmentsController < Admin::BaseController end def resource_name - resource_model.parameterize("_") + resource_model.parameterize(separator: "_") end def load_investments diff --git a/app/controllers/valuation/budget_investments_controller.rb b/app/controllers/valuation/budget_investments_controller.rb index 5562280c2..aa29120f1 100644 --- a/app/controllers/valuation/budget_investments_controller.rb +++ b/app/controllers/valuation/budget_investments_controller.rb @@ -61,7 +61,7 @@ class Valuation::BudgetInvestmentsController < Valuation::BaseController end def resource_name - resource_model.parameterize("_") + resource_model.parameterize(separator: "_") end def load_budget diff --git a/app/helpers/documentables_helper.rb b/app/helpers/documentables_helper.rb index b17278019..ef1a2d6b9 100644 --- a/app/helpers/documentables_helper.rb +++ b/app/helpers/documentables_helper.rb @@ -1,7 +1,7 @@ module DocumentablesHelper def documentable_class(documentable) - documentable.class.name.parameterize("_") + documentable.class.name.parameterize(separator: "_") end def max_documents_allowed(documentable) diff --git a/app/helpers/followables_helper.rb b/app/helpers/followables_helper.rb index 5641a33bc..bf6cbd8f6 100644 --- a/app/helpers/followables_helper.rb +++ b/app/helpers/followables_helper.rb @@ -22,7 +22,7 @@ module FollowablesHelper end def followable_class_name(followable) - followable.class.to_s.parameterize("_") + followable.class.to_s.parameterize(separator: "_") end def find_or_build_follow(user, followable) diff --git a/app/helpers/imageables_helper.rb b/app/helpers/imageables_helper.rb index 768578f75..1a85362d8 100644 --- a/app/helpers/imageables_helper.rb +++ b/app/helpers/imageables_helper.rb @@ -5,7 +5,7 @@ module ImageablesHelper end def imageable_class(imageable) - imageable.class.name.parameterize("_") + imageable.class.name.parameterize(separator: "_") end def imageable_max_file_size diff --git a/spec/models/concerns/sluggable.rb b/spec/models/concerns/sluggable.rb index cba8960f5..d1dd64720 100644 --- a/spec/models/concerns/sluggable.rb +++ b/spec/models/concerns/sluggable.rb @@ -3,7 +3,7 @@ require "spec_helper" shared_examples_for "sluggable" do |updatable_slug_trait:| describe "generate_slug" do - let(:factory_name) { described_class.name.parameterize("_").to_sym } + let(:factory_name) { described_class.name.parameterize(separator: "_").to_sym } let(:sluggable) { create(factory_name, name: "Marló Brañido Carlo") } context "when a new sluggable is created" do diff --git a/spec/shared/features/relationable.rb b/spec/shared/features/relationable.rb index 0771c21b2..ea67fdcbb 100644 --- a/spec/shared/features/relationable.rb +++ b/spec/shared/features/relationable.rb @@ -1,6 +1,6 @@ shared_examples "relationable" do |relationable_model_name| - let(:relationable) { create(relationable_model_name.name.parameterize("_").to_sym) } + let(:relationable) { create(relationable_model_name.name.parameterize(separator: "_").to_sym) } let(:related1) { create([:proposal, :debate, :budget_investment].sample) } let(:related2) { create([:proposal, :debate, :budget_investment].sample) } let(:user) { create(:user) } From 90bcfe7a78f9f8238d87159337a84a7f2c83a55f Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sun, 8 Apr 2018 14:08:09 +0200 Subject: [PATCH 062/104] Fix parameterise deprecation warning DEPRECATION WARNING: Passing the separator argument as a positional parameter is deprecated and will soon be removed. Use `separator: '_'` instead. (called from followable_translation_key at /home/travis/build/consul/consul/app/controllers/follows_controller.rb:2 5) --- app/controllers/follows_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/follows_controller.rb b/app/controllers/follows_controller.rb index 05f0e8f96..78185b5b4 100644 --- a/app/controllers/follows_controller.rb +++ b/app/controllers/follows_controller.rb @@ -22,7 +22,7 @@ class FollowsController < ApplicationController end def followable_translation_key(followable) - followable.class.name.parameterize("_") + followable.class.name.parameterize(separator: "_") end end From cb1ed017f9f06de5a2b6cd254f5d4a0fbf39e746 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Tue, 7 Aug 2018 17:24:03 -0400 Subject: [PATCH 063/104] Use `separator` key when parameterizing arguments --- app/views/welcome/_feeds.html.erb | 4 ++-- app/views/welcome/_processes.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/welcome/_feeds.html.erb b/app/views/welcome/_feeds.html.erb index b255ed526..37f21df18 100644 --- a/app/views/welcome/_feeds.html.erb +++ b/app/views/welcome/_feeds.html.erb @@ -8,7 +8,7 @@

<%= t("welcome.feed.most_active.#{feed.kind}") %>

<% feed.items.each do |item| %> -
row"> +
row">
"> <%= link_to item.title, url_for(item) %>
@@ -37,7 +37,7 @@

<%= t("welcome.feed.most_active.#{feed.kind}") %>

<% feed.items.each do |item| %> -
"> +
"> <%= link_to item.title, url_for(item) %>
<% end %> diff --git a/app/views/welcome/_processes.html.erb b/app/views/welcome/_processes.html.erb index 3433d7182..556c6e066 100644 --- a/app/views/welcome/_processes.html.erb +++ b/app/views/welcome/_processes.html.erb @@ -8,7 +8,7 @@ <% feed.items.each do |item| %> <%= link_to url_for(item) do %> -
"> +
"> <%= image_tag("welcome_process.png", alt: "") %>
<%= t("welcome.feed.process_label") %>
From 7ddbf5ff35f2c0e4f3a134470f9ffa4120841445 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Tue, 7 Aug 2018 17:24:03 -0400 Subject: [PATCH 064/104] Use `separator` key when parameterizing arguments --- spec/support/common_actions/notifications.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/support/common_actions/notifications.rb b/spec/support/common_actions/notifications.rb index 0aa0d9a82..3cae9c4ea 100644 --- a/spec/support/common_actions/notifications.rb +++ b/spec/support/common_actions/notifications.rb @@ -10,7 +10,7 @@ module Notifications end def comment_body(resource) - "comment-body-#{resource.class.name.parameterize("_").to_sym}_#{resource.id}" + "comment-body-#{resource.class.name.parameterize(separator: "_").to_sym}_#{resource.id}" end def create_proposal_notification(proposal) From b62eff841cbc501fc4752441c696fb3772bb81ea Mon Sep 17 00:00:00 2001 From: rgarcia Date: Sun, 8 Apr 2018 14:37:39 +0200 Subject: [PATCH 065/104] Fix symbolize_keys deprectation warning DEPRECATION WARNING: Method symbolize_keys is deprecated and will be removed in Rails 5.1, as `ActionController::Parameters` no longer inherits from hash. Using this deprecated behavior exposes potential security problems. If you continue to use this method you may be creating a security vulnerability in your app that can be exploited. Instead, consider using one of these documented methods which are not deprecated: http://api.rubyonrails.org/v5.0.4/classes/ActionController/Parameters.ht ml (called from csv_params at /home/travis/build/consul/consul/app/helpers/budgets_helper.rb:15) --- app/helpers/budgets_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/helpers/budgets_helper.rb b/app/helpers/budgets_helper.rb index e4a47557b..15fdc91a8 100644 --- a/app/helpers/budgets_helper.rb +++ b/app/helpers/budgets_helper.rb @@ -12,7 +12,8 @@ module BudgetsHelper end def csv_params - csv_params = params.clone.merge(format: :csv).symbolize_keys + csv_params = params.clone.merge(format: :csv) + csv_params = csv_params.to_unsafe_h.map { |k, v| [k.to_sym, v] }.to_h csv_params.delete(:page) csv_params end From 0f34cae2addc940955ec8cf3f8ff66f407172f73 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Fri, 16 Jun 2017 13:14:41 +0200 Subject: [PATCH 066/104] updates specs to new keyword styles --- spec/controllers/comments_controller_spec.rb | 6 +- spec/controllers/graphql_controller_spec.rb | 18 ++-- .../annotations_controller_spec.rb | 88 +++++++++++-------- .../legislation/answers_controller_spec.rb | 9 +- 4 files changed, 64 insertions(+), 57 deletions(-) diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index c267f3814..6fbcd3c7c 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -14,7 +14,7 @@ describe CommentsController do sign_in @user expect do - xhr :post, :create, comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"} + post :create, params: {comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}}, xhr: true end.to change { @question.reload.comments_count }.by(1) end @@ -23,7 +23,7 @@ describe CommentsController do @process.update_attribute(:debate_end_date, Date.current - 1.day) expect do - xhr :post, :create, comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"} + post :create, params: {comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}}, xhr: true end.not_to change { @question.reload.comments_count } end @@ -31,7 +31,7 @@ describe CommentsController do sign_in @unverified_user expect do - xhr :post, :create, comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"} + post :create, params: {comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}}, xhr: true end.not_to change { @question.reload.comments_count } end end diff --git a/spec/controllers/graphql_controller_spec.rb b/spec/controllers/graphql_controller_spec.rb index 4cd6ba8c6..c975ec160 100644 --- a/spec/controllers/graphql_controller_spec.rb +++ b/spec/controllers/graphql_controller_spec.rb @@ -13,14 +13,14 @@ describe GraphqlController, type: :request do describe "handles GET request" do specify "with query string inside query params" do - get "/graphql", query: "{ proposal(id: #{proposal.id}) { title } }" + get "/graphql", params: { query: "{ proposal(id: #{proposal.id}) { title } }" } expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)["data"]["proposal"]["title"]).to eq(proposal.title) end specify "with malformed query string" do - get "/graphql", query: "Malformed query string" + get "/graphql", params: { query: "Malformed query string" } expect(response).to have_http_status(:ok) expect(parser_error_raised?(response)).to be_truthy @@ -38,7 +38,7 @@ describe GraphqlController, type: :request do let(:json_headers) { { "CONTENT_TYPE" => "application/json" } } specify "with json-encoded query string inside body" do - post "/graphql", { query: "{ proposal(id: #{proposal.id}) { title } }" }.to_json, json_headers + post "/graphql", params: { query: "{ proposal(id: #{proposal.id}) { title } }" }.to_json, headers: json_headers expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)["data"]["proposal"]["title"]).to eq(proposal.title) @@ -46,21 +46,21 @@ describe GraphqlController, type: :request do specify "with raw query string inside body" do graphql_headers = { "CONTENT_TYPE" => "application/graphql" } - post "/graphql", "{ proposal(id: #{proposal.id}) { title } }", graphql_headers + post "/graphql", params: "{ proposal(id: #{proposal.id}) { title } }", headers: graphql_headers expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)["data"]["proposal"]["title"]).to eq(proposal.title) end specify "with malformed query string" do - post "/graphql", { query: "Malformed query string" }.to_json, json_headers + post "/graphql", params: { query: "Malformed query string" }.to_json, headers: json_headers expect(response).to have_http_status(:ok) expect(parser_error_raised?(response)).to be_truthy end it "without query string" do - post "/graphql", json_headers + post "/graphql", headers: json_headers expect(response).to have_http_status(:bad_request) expect(JSON.parse(response.body)["message"]).to eq("Query string not present") @@ -71,19 +71,19 @@ describe GraphqlController, type: :request do let(:query_string) { "{ proposal(id: #{proposal.id}) { title } }" } specify "when absent" do - get "/graphql", query: query_string + get "/graphql", params: { query: query_string } expect(response).to have_http_status(:ok) end specify "when specified as the 'null' string" do - get "/graphql", query: query_string, variables: "null" + get "/graphql", params: { query: query_string, variables: "null" } expect(response).to have_http_status(:ok) end specify "when specified as an empty string" do - get "/graphql", query: query_string, variables: "" + get "/graphql", params: { query: query_string, variables: "" } expect(response).to have_http_status(:ok) end diff --git a/spec/controllers/legislation/annotations_controller_spec.rb b/spec/controllers/legislation/annotations_controller_spec.rb index d7847d9fa..1b7f6cac0 100644 --- a/spec/controllers/legislation/annotations_controller_spec.rb +++ b/spec/controllers/legislation/annotations_controller_spec.rb @@ -13,13 +13,14 @@ describe Legislation::AnnotationsController do it "creates an ahoy event" do sign_in @user - post :create, process_id: @process.id, - draft_version_id: @draft_version.id, - legislation_annotation: { - "quote" => "ipsum", - "ranges" => [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}], - "text": "una anotacion" - } + post :create, params: { + process_id: @process.id, + draft_version_id: @draft_version.id, + legislation_annotation: { + "quote"=>"ipsum", + "ranges"=>[{"start"=>"/p[1]", "startOffset"=>6, "end"=>"/p[1]", "endOffset"=>11}], + "text": "una anotacion" + }} expect(Ahoy::Event.where(name: :legislation_annotation_created).count).to eq 1 expect(Ahoy::Event.last.properties["legislation_annotation_id"]).to eq Legislation::Annotation.last.id end @@ -27,13 +28,14 @@ describe Legislation::AnnotationsController do it "does not create an annotation if the draft version is a final version" do sign_in @user - post :create, process_id: @process.id, + post :create, params: { + process_id: @process.id, draft_version_id: @final_version.id, legislation_annotation: { "quote" => "ipsum", "ranges" => [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}], "text": "una anotacion" - } + }} expect(response).to have_http_status(:not_found) end @@ -42,13 +44,15 @@ describe Legislation::AnnotationsController do sign_in @user expect do - xhr :post, :create, process_id: @process.id, - draft_version_id: @draft_version.id, - legislation_annotation: { - "quote" => "ipsum", - "ranges" => [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}], - "text": "una anotacion" - } + post :create, params: { + process_id: @process.id, + draft_version_id: @draft_version.id, + legislation_annotation: { + "quote"=>"ipsum", + "ranges"=>[{"start"=>"/p[1]", "startOffset"=>6, "end"=>"/p[1]", "endOffset"=>11}], + "text": "una anotacion" + }}, + xhr: true end.to change { @draft_version.annotations.count }.by(1) end @@ -57,27 +61,31 @@ describe Legislation::AnnotationsController do @process.update_attribute(:allegations_end_date, Date.current - 1.day) expect do - xhr :post, :create, process_id: @process.id, - draft_version_id: @draft_version.id, - legislation_annotation: { - "quote" => "ipsum", - "ranges" => [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}], - "text": "una anotacion" - } - end.not_to change { @draft_version.annotations.count } + post :create, params: { + process_id: @process.id, + draft_version_id: @draft_version.id, + legislation_annotation: { + "quote"=>"ipsum", + "ranges"=>[{"start"=>"/p[1]", "startOffset"=>6, "end"=>"/p[1]", "endOffset"=>11}], + "text": "una anotacion" + }}, + xhr: true + end.to_not change { @draft_version.annotations.count } end it "creates an annotation by parsing parameters in JSON" do sign_in @user expect do - xhr :post, :create, process_id: @process.id, - draft_version_id: @draft_version.id, - legislation_annotation: { - "quote" => "ipsum", - "ranges" => [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}].to_json, - "text": "una anotacion" - } + post :create, params: { + process_id: @process.id, + draft_version_id: @draft_version.id, + legislation_annotation: { + "quote"=>"ipsum", + "ranges"=>[{"start"=>"/p[1]", "startOffset"=>6, "end"=>"/p[1]", "endOffset"=>11}].to_json, + "text": "una anotacion" + }}, + xhr: true end.to change { @draft_version.annotations.count }.by(1) end @@ -88,14 +96,16 @@ describe Legislation::AnnotationsController do sign_in @user expect do - xhr :post, :create, process_id: @process.id, - draft_version_id: @draft_version.id, - legislation_annotation: { - "quote" => "ipsum", - "ranges" => [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}], - "text": "una anotacion" - } - end.not_to change { @draft_version.annotations.count } + post :create, params: { + process_id: @process.id, + draft_version_id: @draft_version.id, + legislation_annotation: { + "quote"=>"ipsum", + "ranges"=>[{"start"=>"/p[1]", "startOffset"=>6, "end"=>"/p[1]", "endOffset"=>11}], + "text": "una anotacion" + }}, + xhr: true + end.to_not change { @draft_version.annotations.count } expect(annotation.reload.comments_count).to eq(2) expect(annotation.comments.last.body).to eq("una anotacion") diff --git a/spec/controllers/legislation/answers_controller_spec.rb b/spec/controllers/legislation/answers_controller_spec.rb index b5ef6dd96..3f2e0955f 100644 --- a/spec/controllers/legislation/answers_controller_spec.rb +++ b/spec/controllers/legislation/answers_controller_spec.rb @@ -13,8 +13,7 @@ describe Legislation::AnswersController do it "creates an ahoy event" do sign_in @user - post :create, process_id: @process.id, question_id: @question.id, - legislation_answer: { legislation_question_option_id: @question_option.id } + post :create, params: {process_id: @process.id, question_id: @question.id, legislation_answer: { legislation_question_option_id: @question_option.id }} expect(Ahoy::Event.where(name: :legislation_answer_created).count).to eq 1 expect(Ahoy::Event.last.properties["legislation_answer_id"]).to eq Legislation::Answer.last.id end @@ -23,8 +22,7 @@ describe Legislation::AnswersController do sign_in @user expect do - xhr :post, :create, process_id: @process.id, question_id: @question.id, - legislation_answer: { legislation_question_option_id: @question_option.id } + post :create, params: {process_id: @process.id, question_id: @question.id, legislation_answer: { legislation_question_option_id: @question_option.id }}, xhr: true end.to change { @question.reload.answers_count }.by(1) end @@ -33,8 +31,7 @@ describe Legislation::AnswersController do @process.update_attribute(:debate_end_date, Date.current - 1.day) expect do - xhr :post, :create, process_id: @process.id, question_id: @question.id, - legislation_answer: { legislation_question_option_id: @question_option.id } + post :create, params: {process_id: @process.id, question_id: @question.id, legislation_answer: { legislation_question_option_id: @question_option.id }}, xhr: true end.not_to change { @question.reload.answers_count } end end From bca824b7598f723e4e2d8562e747f9d5abfd1e68 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Wed, 26 Oct 2016 00:56:44 +0200 Subject: [PATCH 067/104] removes controller spec deprecation warnings --- spec/controllers/concerns/has_filters_spec.rb | 6 +++--- spec/controllers/pages_controller_spec.rb | 14 +++++++------- .../users/registrations_controller_spec.rb | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/spec/controllers/concerns/has_filters_spec.rb b/spec/controllers/concerns/has_filters_spec.rb index b7d2ba870..feedbccc4 100644 --- a/spec/controllers/concerns/has_filters_spec.rb +++ b/spec/controllers/concerns/has_filters_spec.rb @@ -9,7 +9,7 @@ describe HasFilters do has_filters ["all", "pending", "reviewed"], only: :index def index - render text: "#{@current_filter} (#{@valid_filters.join(" ")})" + render plain: "#{@current_filter} (#{@valid_filters.join(" ")})" end end @@ -25,12 +25,12 @@ describe HasFilters do end it "can be changed by the filter param" do - get :index, filter: "pending" + get :index, params: { filter: "pending" } expect(response.body).to eq("pending (all pending reviewed)") end it "defaults to the first one on the list if given a bogus filter" do - get :index, filter: "foobar" + get :index, params: { filter: "foobar" } expect(response.body).to eq("all (all pending reviewed)") end end diff --git a/spec/controllers/pages_controller_spec.rb b/spec/controllers/pages_controller_spec.rb index a4b05f768..ac0678691 100644 --- a/spec/controllers/pages_controller_spec.rb +++ b/spec/controllers/pages_controller_spec.rb @@ -4,17 +4,17 @@ describe PagesController do describe "Static pages" do it "includes a privacy page" do - get :show, id: :privacy + get :show, params: { id: :privacy } expect(response).to be_ok end it "includes a conditions page" do - get :show, id: :conditions + get :show, params: { id: :conditions } expect(response).to be_ok end it "includes a accessibility page" do - get :show, id: :accessibility + get :show, params: { id: :accessibility } expect(response).to be_ok end end @@ -22,24 +22,24 @@ describe PagesController do describe "More info pages" do it "includes a more info page" do - get :show, id: "help/index" + get :show, params: { id: "help/index" } expect(response).to be_ok end it "includes a how_to_use page" do - get :show, id: "help/how_to_use/index" + get :show, params: { id: "help/how_to_use/index" } expect(response).to be_ok end it "includes a faq page" do - get :show, id: :faq + get :show, params: { id: :faq } expect(response).to be_ok end end describe "Not found pages" do it "returns a 404 message" do - get :show, id: "nonExistentPage" + get :show, params: { id: "nonExistentPage" } expect(response).to be_missing end end diff --git a/spec/controllers/users/registrations_controller_spec.rb b/spec/controllers/users/registrations_controller_spec.rb index 82269703e..2a82842b0 100644 --- a/spec/controllers/users/registrations_controller_spec.rb +++ b/spec/controllers/users/registrations_controller_spec.rb @@ -10,7 +10,7 @@ describe Users::RegistrationsController do context "when username is available" do it "returns true with no error message" do - get :check_username, username: "available username" + get :check_username, params: { username: "available username" } data = JSON.parse response.body, symbolize_names: true expect(data[:available]).to be true @@ -21,7 +21,7 @@ describe Users::RegistrationsController do context "when username is not available" do it "returns false with an error message" do user = create(:user) - get :check_username, username: user.username + get :check_username, params: { username: user.username } data = JSON.parse response.body, symbolize_names: true expect(data[:available]).to be false From a910eb69cd091a1305f3074f76e4a0fd10a3dc42 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Wed, 26 Oct 2016 01:03:31 +0200 Subject: [PATCH 068/104] removes stats controller spec deprecation warning --- spec/controllers/admin/api/stats_controller_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/controllers/admin/api/stats_controller_spec.rb b/spec/controllers/admin/api/stats_controller_spec.rb index 2db94c7d3..cee087d71 100644 --- a/spec/controllers/admin/api/stats_controller_spec.rb +++ b/spec/controllers/admin/api/stats_controller_spec.rb @@ -31,7 +31,7 @@ describe Admin::Api::StatsController do it "returns single events formated for working with c3.js" do sign_in user - get :show, events: "foo" + get :show, params: { events: "foo" } expect(response).to be_ok @@ -41,7 +41,7 @@ describe Admin::Api::StatsController do it "returns combined comma separated events formated for working with c3.js" do sign_in user - get :show, events: "foo,bar" + get :show, params: { events: "foo,bar" } expect(response).to be_ok @@ -60,7 +60,7 @@ describe Admin::Api::StatsController do create :visit, started_at: time_2 sign_in user - get :show, visits: true + get :show, params: { visits: true } expect(response).to be_ok @@ -83,7 +83,7 @@ describe Admin::Api::StatsController do create :visit, started_at: time_2 sign_in user - get :show, events: "foo", visits: true + get :show, params: { events: "foo", visits: true } expect(response).to be_ok From 9a49716f22993e4f9057ff30866706722497fcf1 Mon Sep 17 00:00:00 2001 From: rgarcia Date: Wed, 26 Oct 2016 03:05:52 +0200 Subject: [PATCH 069/104] updates controller specs deprecation warnings --- spec/controllers/concerns/has_orders_spec.rb | 6 +++--- spec/controllers/debates_controller_spec.rb | 6 +++--- spec/controllers/management/sessions_controller_spec.rb | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spec/controllers/concerns/has_orders_spec.rb b/spec/controllers/concerns/has_orders_spec.rb index a14346802..ed0edf583 100644 --- a/spec/controllers/concerns/has_orders_spec.rb +++ b/spec/controllers/concerns/has_orders_spec.rb @@ -10,7 +10,7 @@ describe HasOrders do has_orders ->(c) { ["votes_count", "flags_count"] }, only: :new def index - render text: "#{@current_order} (#{@valid_orders.join(" ")})" + render plain: "#{@current_order} (#{@valid_orders.join(" ")})" end def new @@ -48,12 +48,12 @@ describe HasOrders do end it "can be changed by the order param" do - get :index, order: "votes_count" + get :index, params: { order: "votes_count" } expect(response.body).to eq("votes_count (created_at votes_count flags_count)") end it "defaults to the first one on the list if given a bogus order" do - get :index, order: "foobar" + get :index, params: { order: "foobar" } expect(response.body).to eq("created_at (created_at votes_count flags_count)") end end diff --git a/spec/controllers/debates_controller_spec.rb b/spec/controllers/debates_controller_spec.rb index 7f89a75ae..ad1d66bf2 100644 --- a/spec/controllers/debates_controller_spec.rb +++ b/spec/controllers/debates_controller_spec.rb @@ -15,7 +15,7 @@ describe DebatesController do sign_in create(:user) - post :create, debate: { title: "A sample debate", description: "this is a sample debate", terms_of_service: 1 } + post :create, params: { debate: { title: "A sample debate", description: "this is a sample debate", terms_of_service: 1 }} expect(Ahoy::Event.where(name: :debate_created).count).to eq 1 expect(Ahoy::Event.last.properties["debate_id"]).to eq Debate.last.id end @@ -32,7 +32,7 @@ describe DebatesController do sign_in create(:user) expect do - xhr :post, :vote, id: debate.id, value: "yes" + post :vote, xhr: true, params: { id: debate.id, value: "yes" } end.to change { debate.reload.votes_for.size }.by(1) end @@ -42,7 +42,7 @@ describe DebatesController do sign_in create(:user) expect do - xhr :post, :vote, id: debate.id, value: "yes" + post :vote, xhr: true, params: { id: debate.id, value: "yes" } end.not_to change { debate.reload.votes_for.size } end end diff --git a/spec/controllers/management/sessions_controller_spec.rb b/spec/controllers/management/sessions_controller_spec.rb index 7356169ad..979fa3f8c 100644 --- a/spec/controllers/management/sessions_controller_spec.rb +++ b/spec/controllers/management/sessions_controller_spec.rb @@ -5,7 +5,7 @@ describe Management::SessionsController do describe "Sign in" do it "denies access if wrong manager credentials" do allow_any_instance_of(ManagerAuthenticator).to receive(:auth).and_return(false) - expect { get :create, login: "nonexistent", clave_usuario: "wrong"}.to raise_error CanCan::AccessDenied + expect { get :create, params: { login: "nonexistent" , clave_usuario: "wrong" }}.to raise_error CanCan::AccessDenied expect(session[:manager]).to be_nil end @@ -13,7 +13,7 @@ describe Management::SessionsController do manager = {login: "JJB033", user_key: "31415926", date: "20151031135905"} allow_any_instance_of(ManagerAuthenticator).to receive(:auth).and_return(manager) - get :create, login: "JJB033", clave_usuario: "31415926", fecha_conexion: "20151031135905" + get :create, params: { login: "JJB033" , clave_usuario: "31415926", fecha_conexion: "20151031135905" } expect(response).to be_redirect expect(session[:manager][:login]).to eq "JJB033" end From e63f6eec49cc39302b2fe9b7f7c34a20cb2e68c6 Mon Sep 17 00:00:00 2001 From: alejandro Date: Tue, 4 Apr 2017 23:03:35 +0200 Subject: [PATCH 070/104] removes controller spec deprecation warnings --- spec/controllers/concerns/has_orders_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/controllers/concerns/has_orders_spec.rb b/spec/controllers/concerns/has_orders_spec.rb index ed0edf583..f2e0abb43 100644 --- a/spec/controllers/concerns/has_orders_spec.rb +++ b/spec/controllers/concerns/has_orders_spec.rb @@ -29,7 +29,7 @@ describe HasOrders do end it "displays relevance when searching" do - get :index, search: "ipsum" + get :index, params: { search: "ipsum" } expect(response.body).to eq("created_at (created_at votes_count flags_count relevance)") end @@ -37,7 +37,7 @@ describe HasOrders do get :index # Since has_orders did valid_options.delete, the first call to :index might remove 'relevance' from # the list by mistake. - get :index, search: "ipsum" + get :index, params: { search: "ipsum" } expect(response.body).to eq("created_at (created_at votes_count flags_count relevance)") end From fca7ef6cc9abd0d99a120b28421c4c81f7b3162c Mon Sep 17 00:00:00 2001 From: rgarcia Date: Thu, 4 May 2017 03:24:10 +0200 Subject: [PATCH 071/104] removes params deprecation warning --- spec/controllers/admin/api/stats_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/admin/api/stats_controller_spec.rb b/spec/controllers/admin/api/stats_controller_spec.rb index cee087d71..d9a2cdeb4 100644 --- a/spec/controllers/admin/api/stats_controller_spec.rb +++ b/spec/controllers/admin/api/stats_controller_spec.rb @@ -102,7 +102,7 @@ describe Admin::Api::StatsController do budget_investment3 = create(:budget_investment, budget: @budget, created_at: time_2) sign_in user - get :show, budget_investments: true + get :show, params: { budget_investments: true } expect(response).to be_ok From 37aa0829433051d6a9bd801f09b5f84d6f89deb0 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Thu, 12 Apr 2018 09:31:49 -0400 Subject: [PATCH 072/104] Fix `redirect_to` deprecation warning on Admin::Legislation::Processes controller --- app/controllers/admin/legislation/processes_controller.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/legislation/processes_controller.rb b/app/controllers/admin/legislation/processes_controller.rb index 6c0d2ea6f..f0b9c6de3 100644 --- a/app/controllers/admin/legislation/processes_controller.rb +++ b/app/controllers/admin/legislation/processes_controller.rb @@ -27,7 +27,8 @@ class Admin::Legislation::ProcessesController < Admin::Legislation::BaseControll set_tag_list link = legislation_process_path(@process).html_safe - redirect_to :back, notice: t("admin.legislation.processes.update.notice", link: link) + redirect_back(fallback_location: (request.referrer || root_path), + notice: t("admin.legislation.processes.update.notice", link: link)) else flash.now[:error] = t("admin.legislation.processes.update.error") render :edit From ee2b87aedffc5894854bdc5356840260502365b7 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Tue, 7 Aug 2018 17:24:51 -0400 Subject: [PATCH 073/104] Use `.where` clause first when calling `.destroy_all` method --- .../admin/site_customization/information_texts_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/site_customization/information_texts_controller.rb b/app/controllers/admin/site_customization/information_texts_controller.rb index 277ec91a6..85e765cb4 100644 --- a/app/controllers/admin/site_customization/information_texts_controller.rb +++ b/app/controllers/admin/site_customization/information_texts_controller.rb @@ -46,7 +46,7 @@ class Admin::SiteCustomization::InformationTextsController < Admin::SiteCustomiz .keys languages_to_delete.each do |locale| - I18nContentTranslation.destroy_all(locale: locale) + I18nContentTranslation.where(locale: locale).destroy_all end end From e7f39bc454537f3d2745bd3b4e3458df830d7cfe Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Tue, 7 Aug 2018 20:17:26 -0400 Subject: [PATCH 074/104] Use `head :ok` when expecting an empty response body --- app/controllers/admin/widget/feeds_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/widget/feeds_controller.rb b/app/controllers/admin/widget/feeds_controller.rb index ab4a5a474..2becdf28a 100644 --- a/app/controllers/admin/widget/feeds_controller.rb +++ b/app/controllers/admin/widget/feeds_controller.rb @@ -4,7 +4,7 @@ class Admin::Widget::FeedsController < Admin::BaseController @feed = ::Widget::Feed.find(params[:id]) @feed.update(feed_params) - render nothing: true + head :ok end private @@ -13,4 +13,4 @@ class Admin::Widget::FeedsController < Admin::BaseController params.require(:widget_feed).permit(:limit) end -end \ No newline at end of file +end From fb81f45a7330134bfb5851ccc68444e4264bc27d Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Fri, 29 Mar 2019 16:21:20 +0100 Subject: [PATCH 075/104] Fix `redirect_to :back` deprecation warning --- app/controllers/admin/legislation/homepages_controller.rb | 3 ++- .../admin/poll/questions/answers/videos_controller.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/legislation/homepages_controller.rb b/app/controllers/admin/legislation/homepages_controller.rb index 6b2084448..72ff890e9 100644 --- a/app/controllers/admin/legislation/homepages_controller.rb +++ b/app/controllers/admin/legislation/homepages_controller.rb @@ -9,7 +9,8 @@ class Admin::Legislation::HomepagesController < Admin::Legislation::BaseControll def update if @process.update(process_params) link = legislation_process_path(@process).html_safe - redirect_to :back, notice: t("admin.legislation.processes.update.notice", link: link) + redirect_back(fallback_location: (request.referrer || root_path), + notice: t("admin.legislation.processes.update.notice", link: link)) else flash.now[:error] = t("admin.legislation.processes.update.error") render :edit diff --git a/app/controllers/admin/poll/questions/answers/videos_controller.rb b/app/controllers/admin/poll/questions/answers/videos_controller.rb index e9262b6dd..7628ab081 100644 --- a/app/controllers/admin/poll/questions/answers/videos_controller.rb +++ b/app/controllers/admin/poll/questions/answers/videos_controller.rb @@ -38,7 +38,7 @@ class Admin::Poll::Questions::Answers::VideosController < Admin::Poll::BaseContr else t("flash.actions.destroy.error") end - redirect_to :back, notice: notice + redirect_back(fallback_location: (request.referrer || root_path), notice: notice) end private From ceea0d4a3647ad923b9c4553c025f41e503f15ad Mon Sep 17 00:00:00 2001 From: alejandro Date: Thu, 6 Apr 2017 11:54:59 +0200 Subject: [PATCH 076/104] sanitizes params for views --- app/models/budget/investment.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 3bf62613d..37d202c56 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -109,7 +109,7 @@ class Budget end def self.filter_params(params) - params.select{ |x, _| %w{heading_id group_id administrator_id tag_name valuator_id}.include?(x.to_s) } + params.permit(%i[heading_id group_id administrator_id tag_name valuator_id]) end def self.scoped_filter(params, current_filter) From 1a21b779ac661551056c22ba896c32cc17fb301d Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Fri, 29 Mar 2019 18:41:04 +0100 Subject: [PATCH 077/104] Fix deprecation warning calling `env' in controllers --- app/controllers/users/omniauth_callbacks_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 0e0f741a3..67edc4e26 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -25,7 +25,7 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController def sign_in_with(feature, provider) raise ActionController::RoutingError.new("Not Found") unless Setting["feature.#{feature}"] - auth = env["omniauth.auth"] + auth = request.env["omniauth.auth"] identity = Identity.first_or_create_from_oauth(auth) @user = current_user || identity.user || User.first_or_initialize_for_oauth(auth) From 596ef8d1ed1ef69f0a8da169b0afa5117b28f43f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Thu, 17 Jan 2019 20:11:11 +0100 Subject: [PATCH 078/104] Fix queries and scopes after column deletion Some queries were accessing original column instead of the new translatable one. This should have been causing unexpected behavior for requests maded in a different locale than the application default. --- app/controllers/admin/poll/polls_controller.rb | 1 + app/controllers/budgets/executions_controller.rb | 2 +- app/controllers/polls_controller.rb | 2 +- app/models/budget/investment.rb | 2 +- app/models/poll.rb | 2 +- app/models/poll/booth.rb | 2 +- 6 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/poll/polls_controller.rb b/app/controllers/admin/poll/polls_controller.rb index 04a94cce3..90cf751a1 100644 --- a/app/controllers/admin/poll/polls_controller.rb +++ b/app/controllers/admin/poll/polls_controller.rb @@ -67,6 +67,7 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController end def poll_params + image_attributes = [:id, :title, :attachment, :cached_attachment, :user_id, :_destroy] attributes = [:name, :starts_at, :ends_at, :geozone_restricted, :results_enabled, :stats_enabled, :budget_id, geozone_ids: [], image_attributes: image_attributes] diff --git a/app/controllers/budgets/executions_controller.rb b/app/controllers/budgets/executions_controller.rb index 54decebee..0d4c25134 100644 --- a/app/controllers/budgets/executions_controller.rb +++ b/app/controllers/budgets/executions_controller.rb @@ -19,7 +19,7 @@ module Budgets .group_by(&:heading) else @budget.investments.winners - .joins(:milestones).includes(:milestones) + .joins(milestones: :translations) .distinct.group_by(&:heading) end end diff --git a/app/controllers/polls_controller.rb b/app/controllers/polls_controller.rb index 652a9eaae..5fab93a0f 100644 --- a/app/controllers/polls_controller.rb +++ b/app/controllers/polls_controller.rb @@ -11,7 +11,7 @@ class PollsController < ApplicationController ::Poll::Answer # trigger autoload def index - @polls = @polls.not_budget.send(@current_filter).includes(:geozones).sort_for_list.page(params[:page]) + @polls = @polls.not_budget.send(@current_filter).sort_for_list.page(params[:page]) end def show diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 37d202c56..c3842dc94 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -368,7 +368,7 @@ class Budget end def self.with_milestone_status_id(status_id) - joins(:milestones).includes(:milestones).select do |investment| + includes(milestones: :translations).select do |investment| investment.milestone_status_id == status_id.to_i end end diff --git a/app/models/poll.rb b/app/models/poll.rb index 012fce912..e90bf191b 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -37,7 +37,7 @@ class Poll < ActiveRecord::Base scope :public_for_api, -> { all } scope :not_budget, -> { where(budget_id: nil) } - scope :sort_for_list, -> { order(:geozone_restricted, :starts_at, :name) } + scope :sort_for_list, -> { joins(:translations).order(:geozone_restricted, :starts_at, "poll_translations.name") } def title name diff --git a/app/models/poll/booth.rb b/app/models/poll/booth.rb index e794a0190..5dfd32a6f 100644 --- a/app/models/poll/booth.rb +++ b/app/models/poll/booth.rb @@ -12,7 +12,7 @@ class Poll end def self.available - where(polls: { id: Poll.current_or_recounting }).includes(:polls) + where(polls: { id: Poll.current_or_recounting }).joins(polls: :translations) end def assignment_on_poll(poll) From f87804aa906f839ae1fd9a7e3618235e4f7dcbe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Thu, 17 Jan 2019 18:25:37 +0100 Subject: [PATCH 079/104] Update helpers after globalize gem version update Globalize has fixed new translations globalized_model initialization so we have to adapt existing code. --- app/helpers/globalize_helper.rb | 2 +- app/helpers/translatable_form_helper.rb | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/helpers/globalize_helper.rb b/app/helpers/globalize_helper.rb index 575e81c8e..92d02b63e 100644 --- a/app/helpers/globalize_helper.rb +++ b/app/helpers/globalize_helper.rb @@ -12,7 +12,7 @@ module GlobalizeHelper def display_translation?(resource, locale) if !resource || resource.translations.blank? || - resource.translations.map(&:locale).include?(I18n.locale) + resource.locales_not_marked_for_destruction.include?(I18n.locale) locale == I18n.locale else locale == resource.translations.first.locale diff --git a/app/helpers/translatable_form_helper.rb b/app/helpers/translatable_form_helper.rb index 01b0dd2a7..a65221b79 100644 --- a/app/helpers/translatable_form_helper.rb +++ b/app/helpers/translatable_form_helper.rb @@ -6,7 +6,13 @@ module TranslatableFormHelper end class TranslatableFormBuilder < FoundationRailsHelper::FormBuilder + attr_accessor :translations + def translatable_fields(&block) + @translations = {} + @object.globalize_locales.map do |locale| + @translations[locale] = translation_for(locale) + end @object.globalize_locales.map do |locale| Globalize.with_locale(locale) { fields_for_locale(locale, &block) } end.join.html_safe @@ -15,7 +21,7 @@ module TranslatableFormHelper private def fields_for_locale(locale, &block) - fields_for_translation(translation_for(locale)) do |translations_form| + fields_for_translation(@translations[locale]) do |translations_form| @template.content_tag :div, translations_options(translations_form.object, locale) do @template.concat translations_form.hidden_field( :_destroy, From 7c5fa253f5dba0704bbd1374be5ae14b410ec302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Thu, 17 Jan 2019 20:11:11 +0100 Subject: [PATCH 080/104] Fix queries and scopes after column deletion Some queries were accessing original column instead of the new translatable one. This should have been causing unexpected behavior for requests maded in a different locale than the application default. --- app/controllers/admin/poll/polls_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/admin/poll/polls_controller.rb b/app/controllers/admin/poll/polls_controller.rb index 90cf751a1..a543093b2 100644 --- a/app/controllers/admin/poll/polls_controller.rb +++ b/app/controllers/admin/poll/polls_controller.rb @@ -11,9 +11,7 @@ class Admin::Poll::PollsController < Admin::Poll::BaseController end def show - @poll = Poll.includes(:questions). - order("poll_questions.title"). - find(params[:id]) + @poll = Poll.find(params[:id]) end def new From fbfe5b3468887a4e7dd8fa83d1beeae43cce1d84 Mon Sep 17 00:00:00 2001 From: taitus Date: Sat, 23 Mar 2019 21:00:42 +0100 Subject: [PATCH 081/104] Fix specs heading_specs.rb:313 --- app/models/budget/heading.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/budget/heading.rb b/app/models/budget/heading.rb index 4c427759f..40a534f55 100644 --- a/app/models/budget/heading.rb +++ b/app/models/budget/heading.rb @@ -40,8 +40,8 @@ class Budget delegate :budget, :budget_id, to: :group, allow_nil: true - scope :i18n, -> { includes(:translations) } - scope :allow_custom_content, -> { i18n.where(allow_custom_content: true).order(:name) } + scope :i18n, -> { joins(:translations) } + scope :allow_custom_content, -> { i18n.where(allow_custom_content: true).order("budget_heading_translations.name") } def self.sort_by_name all.sort do |heading, other_heading| From 638c80760fb47c4303c3ce7594084eb9afa96ce2 Mon Sep 17 00:00:00 2001 From: taitus Date: Tue, 26 Mar 2019 12:51:23 +0100 Subject: [PATCH 082/104] Fix queries and scopes after column deletion Some queries were accessing original column instead of the new translatable one. This should have been causing unexpected behavior for requests maded in a different locale than the application default. --- app/models/budget/group.rb | 2 +- app/models/user.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/budget/group.rb b/app/models/budget/group.rb index d316d2512..a95d7ea27 100644 --- a/app/models/budget/group.rb +++ b/app/models/budget/group.rb @@ -28,7 +28,7 @@ class Budget validates :budget_id, presence: true validates :slug, presence: true, format: /\A[a-z0-9\-_]+\z/ - scope :sort_by_name, -> { includes(:translations).order(:name) } + scope :sort_by_name, -> { joins(:translations).order(:name) } def single_heading_group? headings.count == 1 diff --git a/app/models/user.rb b/app/models/user.rb index 02157212e..c837fbc6b 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -128,7 +128,7 @@ class User < ActiveRecord::Base end def headings_voted_within_group(group) - Budget::Heading.order("name").where(id: voted_investments.by_group(group).pluck(:heading_id)) + Budget::Heading.joins(:translations).order("name").where(id: voted_investments.by_group(group).pluck(:heading_id)) end def voted_investments From a68098eaedc6aab63751b33cb38ad05bcbf26130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Fri, 4 Jan 2019 14:03:49 +0100 Subject: [PATCH 083/104] Fix sanitization for translatable description attribute Move method from sanitizable to globalizable concern because globalize_accessors were overiding sanitizable method and was never called. Another solution to this could be to load sanitizable always after globalizable concern. Old method implementation was not working well with globalize_accessors, it was returning nil always. --- app/models/concerns/globalizable.rb | 4 ++++ app/models/concerns/sanitizable.rb | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/models/concerns/globalizable.rb b/app/models/concerns/globalizable.rb index 2e8d3b935..f963787c7 100644 --- a/app/models/concerns/globalizable.rb +++ b/app/models/concerns/globalizable.rb @@ -12,6 +12,10 @@ module Globalizable def assign_model_to_translations translations.each { |translation| translation.globalized_model = self } end + + def description + self.read_attribute(:description).try :html_safe + end end class_methods do diff --git a/app/models/concerns/sanitizable.rb b/app/models/concerns/sanitizable.rb index 055859c8b..4e3251fc1 100644 --- a/app/models/concerns/sanitizable.rb +++ b/app/models/concerns/sanitizable.rb @@ -6,10 +6,6 @@ module Sanitizable before_validation :sanitize_tag_list end - def description - super.try :html_safe - end - protected def sanitize_description From 0b3a3b97f7e6b9624ac359ef95b1f9495412eb79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Fri, 25 Jan 2019 10:55:27 +0100 Subject: [PATCH 084/104] Santitize description translations Sanitize all not marked for destruction translations when description is a translatable attribute. --- app/models/concerns/sanitizable.rb | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/app/models/concerns/sanitizable.rb b/app/models/concerns/sanitizable.rb index 4e3251fc1..b5b3fd431 100644 --- a/app/models/concerns/sanitizable.rb +++ b/app/models/concerns/sanitizable.rb @@ -9,11 +9,35 @@ module Sanitizable protected def sanitize_description - self.description = WYSIWYGSanitizer.new.sanitize(description) + if translatable_description? + sanitize_description_translations + else + self.description = WYSIWYGSanitizer.new.sanitize(description) + end end def sanitize_tag_list self.tag_list = TagSanitizer.new.sanitize_tag_list(tag_list) if self.class.taggable? end + def translatable_description? + self.class.included_modules.include?(Globalizable) && self.class.translated_attribute_names.include?(:description) + end + + def sanitize_description_translations + # Sanitize description when using attribute accessor in place of nested translations. + # This is because Globalize gem create translations on after save callback + # https://github.com/globalize/globalize/blob/e37c471775d196cd4318e61954572c300c015467/lib/globalize/active_record/act_macro.rb#L105 + if translations.empty? + Globalize.with_locale(I18n.locale) do + self.description = WYSIWYGSanitizer.new.sanitize(description) + end + end + + translations.reject(&:_destroy).each do |translation| + Globalize.with_locale(translation.locale) do + self.description = WYSIWYGSanitizer.new.sanitize(description) + end + end + end end From aa3e8c84589327448a9fda7a7143ceab685accc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Fri, 25 Jan 2019 13:27:51 +0100 Subject: [PATCH 085/104] Keep method for not yet globalizable models Maintain the method for models that are still translatable. This help me to pass the CI build. In later PR's this method will be eliminated as no one will invoke it. --- app/models/concerns/sanitizable.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/models/concerns/sanitizable.rb b/app/models/concerns/sanitizable.rb index b5b3fd431..fc296c4b5 100644 --- a/app/models/concerns/sanitizable.rb +++ b/app/models/concerns/sanitizable.rb @@ -4,6 +4,12 @@ module Sanitizable included do before_validation :sanitize_description before_validation :sanitize_tag_list + + unless included_modules.include? Globalizable + def description + super.try :html_safe + end + end end protected From b7d9ef6377a2bd73e9dd967df63e965072186861 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Wed, 14 Sep 2016 12:31:59 +0200 Subject: [PATCH 086/104] models inherits from ApplicationRecord --- app/models/activity.rb | 2 +- app/models/administrator.rb | 2 +- app/models/ahoy/event.rb | 2 +- app/models/application_record.rb | 3 +++ app/models/banner.rb | 2 +- app/models/campaign.rb | 2 +- app/models/comment.rb | 2 +- app/models/debate.rb | 2 +- app/models/direct_message.rb | 2 +- app/models/failed_census_call.rb | 2 +- app/models/flag.rb | 2 +- app/models/geozone.rb | 2 +- app/models/identity.rb | 2 +- app/models/lock.rb | 2 +- app/models/manager.rb | 2 +- app/models/moderator.rb | 2 +- app/models/notification.rb | 2 +- app/models/organization.rb | 2 +- app/models/proposal.rb | 2 +- app/models/proposal_notification.rb | 2 +- app/models/setting.rb | 2 +- app/models/spending_proposal.rb | 2 +- app/models/user.rb | 2 +- app/models/valuation_assignment.rb | 2 +- app/models/valuator.rb | 2 +- app/models/verified_user.rb | 2 +- app/models/visit.rb | 2 +- 27 files changed, 29 insertions(+), 26 deletions(-) create mode 100644 app/models/application_record.rb diff --git a/app/models/activity.rb b/app/models/activity.rb index b5f3e0281..ed617c97a 100644 --- a/app/models/activity.rb +++ b/app/models/activity.rb @@ -1,4 +1,4 @@ -class Activity < ActiveRecord::Base +class Activity < ApplicationRecord belongs_to :actionable, -> { with_hidden }, polymorphic: true belongs_to :user, -> { with_hidden } diff --git a/app/models/administrator.rb b/app/models/administrator.rb index 6cfafe8d9..b8b6cc1c0 100644 --- a/app/models/administrator.rb +++ b/app/models/administrator.rb @@ -1,4 +1,4 @@ -class Administrator < ActiveRecord::Base +class Administrator < ApplicationRecord belongs_to :user, touch: true delegate :name, :email, :name_and_email, to: :user diff --git a/app/models/ahoy/event.rb b/app/models/ahoy/event.rb index 2aac3c59c..ec7e9c57e 100644 --- a/app/models/ahoy/event.rb +++ b/app/models/ahoy/event.rb @@ -1,5 +1,5 @@ module Ahoy - class Event < ActiveRecord::Base + class Event < ApplicationRecord self.table_name = "ahoy_events" belongs_to :visit diff --git a/app/models/application_record.rb b/app/models/application_record.rb new file mode 100644 index 000000000..7a81004d1 --- /dev/null +++ b/app/models/application_record.rb @@ -0,0 +1,3 @@ +class ApplicationRecord < ApplicationRecord + self.abstract_class = true +end \ No newline at end of file diff --git a/app/models/banner.rb b/app/models/banner.rb index cc05b3970..9b8ce7b3c 100644 --- a/app/models/banner.rb +++ b/app/models/banner.rb @@ -1,4 +1,4 @@ -class Banner < ActiveRecord::Base +class Banner < ApplicationRecord acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases diff --git a/app/models/campaign.rb b/app/models/campaign.rb index 3ce027734..69ab7c811 100644 --- a/app/models/campaign.rb +++ b/app/models/campaign.rb @@ -1,2 +1,2 @@ -class Campaign < ActiveRecord::Base +class Campaign < ApplicationRecord end diff --git a/app/models/comment.rb b/app/models/comment.rb index 93944cb7e..76e314c23 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -1,4 +1,4 @@ -class Comment < ActiveRecord::Base +class Comment < ApplicationRecord include Flaggable include HasPublicAuthor include Graphqlable diff --git a/app/models/debate.rb b/app/models/debate.rb index e3b1aad68..fa4130038 100644 --- a/app/models/debate.rb +++ b/app/models/debate.rb @@ -1,5 +1,5 @@ require "numeric" -class Debate < ActiveRecord::Base +class Debate < ApplicationRecord include Rails.application.routes.url_helpers include Flaggable include Taggable diff --git a/app/models/direct_message.rb b/app/models/direct_message.rb index b4907ae7a..4f3b08482 100644 --- a/app/models/direct_message.rb +++ b/app/models/direct_message.rb @@ -1,4 +1,4 @@ -class DirectMessage < ActiveRecord::Base +class DirectMessage < ApplicationRecord belongs_to :sender, class_name: "User", foreign_key: "sender_id" belongs_to :receiver, class_name: "User", foreign_key: "receiver_id" diff --git a/app/models/failed_census_call.rb b/app/models/failed_census_call.rb index c0add2070..7b3c994d8 100644 --- a/app/models/failed_census_call.rb +++ b/app/models/failed_census_call.rb @@ -1,4 +1,4 @@ -class FailedCensusCall < ActiveRecord::Base +class FailedCensusCall < ApplicationRecord belongs_to :user, counter_cache: true belongs_to :poll_officer, class_name: "Poll::Officer", counter_cache: true end diff --git a/app/models/flag.rb b/app/models/flag.rb index a05d8a737..e69393d49 100644 --- a/app/models/flag.rb +++ b/app/models/flag.rb @@ -1,4 +1,4 @@ -class Flag < ActiveRecord::Base +class Flag < ApplicationRecord belongs_to :user belongs_to :flaggable, polymorphic: true, counter_cache: true, touch: true diff --git a/app/models/geozone.rb b/app/models/geozone.rb index 7cdcbab27..f32af5ec6 100644 --- a/app/models/geozone.rb +++ b/app/models/geozone.rb @@ -1,4 +1,4 @@ -class Geozone < ActiveRecord::Base +class Geozone < ApplicationRecord include Graphqlable diff --git a/app/models/identity.rb b/app/models/identity.rb index e3704da01..311ac61e4 100644 --- a/app/models/identity.rb +++ b/app/models/identity.rb @@ -1,4 +1,4 @@ -class Identity < ActiveRecord::Base +class Identity < ApplicationRecord belongs_to :user validates :provider, presence: true diff --git a/app/models/lock.rb b/app/models/lock.rb index 57d437884..bcfa41196 100644 --- a/app/models/lock.rb +++ b/app/models/lock.rb @@ -1,4 +1,4 @@ -class Lock < ActiveRecord::Base +class Lock < ApplicationRecord belongs_to :user before_save :set_locked_until diff --git a/app/models/manager.rb b/app/models/manager.rb index d9c1aff07..c0e2987e0 100644 --- a/app/models/manager.rb +++ b/app/models/manager.rb @@ -1,4 +1,4 @@ -class Manager < ActiveRecord::Base +class Manager < ApplicationRecord belongs_to :user, touch: true delegate :name, :email, :name_and_email, to: :user diff --git a/app/models/moderator.rb b/app/models/moderator.rb index 6a5af7a52..6871f4cc5 100644 --- a/app/models/moderator.rb +++ b/app/models/moderator.rb @@ -1,4 +1,4 @@ -class Moderator < ActiveRecord::Base +class Moderator < ApplicationRecord belongs_to :user, touch: true delegate :name, :email, to: :user diff --git a/app/models/notification.rb b/app/models/notification.rb index f99cbc1ca..738e5ab5f 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -1,4 +1,4 @@ -class Notification < ActiveRecord::Base +class Notification < ApplicationRecord belongs_to :user, counter_cache: true belongs_to :notifiable, polymorphic: true diff --git a/app/models/organization.rb b/app/models/organization.rb index 0c7aa92e9..2b9be5071 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -1,4 +1,4 @@ -class Organization < ActiveRecord::Base +class Organization < ApplicationRecord include Graphqlable diff --git a/app/models/proposal.rb b/app/models/proposal.rb index dfba48df1..807944b47 100644 --- a/app/models/proposal.rb +++ b/app/models/proposal.rb @@ -1,4 +1,4 @@ -class Proposal < ActiveRecord::Base +class Proposal < ApplicationRecord include Rails.application.routes.url_helpers include Flaggable include Taggable diff --git a/app/models/proposal_notification.rb b/app/models/proposal_notification.rb index bdb9f7698..20fe1f0cb 100644 --- a/app/models/proposal_notification.rb +++ b/app/models/proposal_notification.rb @@ -1,4 +1,4 @@ -class ProposalNotification < ActiveRecord::Base +class ProposalNotification < ApplicationRecord include Graphqlable include Notifiable diff --git a/app/models/setting.rb b/app/models/setting.rb index 764408d27..858d22b0f 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -1,4 +1,4 @@ -class Setting < ActiveRecord::Base +class Setting < ApplicationRecord validates :key, presence: true, uniqueness: true default_scope { order(id: :asc) } diff --git a/app/models/spending_proposal.rb b/app/models/spending_proposal.rb index f5501dc5b..03fb45e79 100644 --- a/app/models/spending_proposal.rb +++ b/app/models/spending_proposal.rb @@ -1,4 +1,4 @@ -class SpendingProposal < ActiveRecord::Base +class SpendingProposal < ApplicationRecord include Measurable include Sanitizable include Taggable diff --git a/app/models/user.rb b/app/models/user.rb index c837fbc6b..4dcba1c6f 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,4 +1,4 @@ -class User < ActiveRecord::Base +class User < ApplicationRecord include Verification diff --git a/app/models/valuation_assignment.rb b/app/models/valuation_assignment.rb index a0505a8aa..2aaea14fb 100644 --- a/app/models/valuation_assignment.rb +++ b/app/models/valuation_assignment.rb @@ -1,4 +1,4 @@ -class ValuationAssignment < ActiveRecord::Base +class ValuationAssignment < ApplicationRecord belongs_to :valuator, counter_cache: :spending_proposals_count belongs_to :spending_proposal, counter_cache: true end diff --git a/app/models/valuator.rb b/app/models/valuator.rb index 2aedfc8f6..70c0a8201 100644 --- a/app/models/valuator.rb +++ b/app/models/valuator.rb @@ -1,4 +1,4 @@ -class Valuator < ActiveRecord::Base +class Valuator < ApplicationRecord belongs_to :user, touch: true belongs_to :valuator_group diff --git a/app/models/verified_user.rb b/app/models/verified_user.rb index 6b0ddb822..205c2dfe9 100644 --- a/app/models/verified_user.rb +++ b/app/models/verified_user.rb @@ -1,4 +1,4 @@ -class VerifiedUser < ActiveRecord::Base +class VerifiedUser < ApplicationRecord scope :by_user, ->(user) { where(document_number: user.document_number) } scope :by_email, ->(email) { where(email: email) } diff --git a/app/models/visit.rb b/app/models/visit.rb index 6bb47fed0..9bcf891d7 100644 --- a/app/models/visit.rb +++ b/app/models/visit.rb @@ -1,4 +1,4 @@ -class Visit < ActiveRecord::Base +class Visit < ApplicationRecord has_many :ahoy_events, class_name: "Ahoy::Event" belongs_to :user end From 1cec362ba7404b1dacd23f24f8ada5f9143102eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Wed, 14 Sep 2016 12:37:56 +0200 Subject: [PATCH 087/104] fixes application_record parent --- app/models/application_record.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/application_record.rb b/app/models/application_record.rb index 7a81004d1..71a1a03cc 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -1,3 +1,3 @@ -class ApplicationRecord < ApplicationRecord +class ApplicationRecord < ActiveRecord::Base self.abstract_class = true end \ No newline at end of file From 7ab602175a43e8739e09714be963e49511c8788c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Thu, 22 Jun 2017 14:16:09 +0200 Subject: [PATCH 088/104] makes models inherit from ApplicationRecord --- app/models/budget.rb | 2 +- app/models/budget/ballot.rb | 2 +- app/models/budget/ballot/line.rb | 2 +- app/models/budget/group.rb | 2 +- app/models/budget/heading.rb | 2 +- app/models/budget/investment.rb | 2 +- app/models/budget/reclassified_vote.rb | 2 +- app/models/budget/valuator_assignment.rb | 2 +- app/models/legislation/annotation.rb | 2 +- app/models/legislation/answer.rb | 2 +- app/models/legislation/draft_version.rb | 2 +- app/models/legislation/process.rb | 2 +- app/models/legislation/question.rb | 2 +- app/models/legislation/question_option.rb | 2 +- app/models/poll.rb | 2 +- app/models/poll/answer.rb | 2 +- app/models/poll/booth.rb | 2 +- app/models/poll/booth_assignment.rb | 2 +- app/models/poll/officer.rb | 2 +- app/models/poll/officer_assignment.rb | 2 +- app/models/poll/partial_result.rb | 2 +- app/models/poll/question.rb | 2 +- app/models/poll/recount.rb | 2 +- app/models/poll/voter.rb | 2 +- app/models/signature.rb | 2 +- app/models/signature_sheet.rb | 2 +- app/models/site_customization/content_block.rb | 2 +- app/models/site_customization/image.rb | 2 +- app/models/site_customization/page.rb | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/app/models/budget.rb b/app/models/budget.rb index ae589302f..8c34e030d 100644 --- a/app/models/budget.rb +++ b/app/models/budget.rb @@ -1,4 +1,4 @@ -class Budget < ActiveRecord::Base +class Budget < ApplicationRecord include Measurable include Sluggable diff --git a/app/models/budget/ballot.rb b/app/models/budget/ballot.rb index 27b0d9100..9539119b0 100644 --- a/app/models/budget/ballot.rb +++ b/app/models/budget/ballot.rb @@ -1,5 +1,5 @@ class Budget - class Ballot < ActiveRecord::Base + class Ballot < ApplicationRecord belongs_to :user belongs_to :budget belongs_to :poll_ballot, class_name: "Poll::Ballot" diff --git a/app/models/budget/ballot/line.rb b/app/models/budget/ballot/line.rb index 2d75c1cd4..54b26f4b4 100644 --- a/app/models/budget/ballot/line.rb +++ b/app/models/budget/ballot/line.rb @@ -1,6 +1,6 @@ class Budget class Ballot - class Line < ActiveRecord::Base + class Line < ApplicationRecord belongs_to :ballot belongs_to :investment, counter_cache: :ballot_lines_count belongs_to :heading diff --git a/app/models/budget/group.rb b/app/models/budget/group.rb index a95d7ea27..d77c840c0 100644 --- a/app/models/budget/group.rb +++ b/app/models/budget/group.rb @@ -1,5 +1,5 @@ class Budget - class Group < ActiveRecord::Base + class Group < ApplicationRecord include Sluggable translates :name, touch: true diff --git a/app/models/budget/heading.rb b/app/models/budget/heading.rb index 40a534f55..0b94aac67 100644 --- a/app/models/budget/heading.rb +++ b/app/models/budget/heading.rb @@ -1,5 +1,5 @@ class Budget - class Heading < ActiveRecord::Base + class Heading < ApplicationRecord OSM_DISTRICT_LEVEL_ZOOM = 12.freeze include Sluggable diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index c3842dc94..2eaf801c1 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -1,5 +1,5 @@ class Budget - class Investment < ActiveRecord::Base + class Investment < ApplicationRecord SORTING_OPTIONS = {id: "id", title: "title", supports: "cached_votes_up"}.freeze include Rails.application.routes.url_helpers diff --git a/app/models/budget/reclassified_vote.rb b/app/models/budget/reclassified_vote.rb index 0eb44d8cc..3f11aa388 100644 --- a/app/models/budget/reclassified_vote.rb +++ b/app/models/budget/reclassified_vote.rb @@ -1,5 +1,5 @@ class Budget - class ReclassifiedVote < ActiveRecord::Base + class ReclassifiedVote < ApplicationRecord REASONS = %w(heading_changed unfeasible) belongs_to :user diff --git a/app/models/budget/valuator_assignment.rb b/app/models/budget/valuator_assignment.rb index 18ef73812..9f60caf1e 100644 --- a/app/models/budget/valuator_assignment.rb +++ b/app/models/budget/valuator_assignment.rb @@ -1,5 +1,5 @@ class Budget - class ValuatorAssignment < ActiveRecord::Base + class ValuatorAssignment < ApplicationRecord belongs_to :valuator, counter_cache: :budget_investments_count belongs_to :investment, counter_cache: true end diff --git a/app/models/legislation/annotation.rb b/app/models/legislation/annotation.rb index 5cb190cc2..93a6c1acf 100644 --- a/app/models/legislation/annotation.rb +++ b/app/models/legislation/annotation.rb @@ -1,4 +1,4 @@ -class Legislation::Annotation < ActiveRecord::Base +class Legislation::Annotation < ApplicationRecord COMMENTS_PAGE_SIZE = 5 acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases diff --git a/app/models/legislation/answer.rb b/app/models/legislation/answer.rb index 298fe9f6d..3bf052167 100644 --- a/app/models/legislation/answer.rb +++ b/app/models/legislation/answer.rb @@ -1,4 +1,4 @@ -class Legislation::Answer < ActiveRecord::Base +class Legislation::Answer < ApplicationRecord acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases diff --git a/app/models/legislation/draft_version.rb b/app/models/legislation/draft_version.rb index 99dafac76..57f1039a4 100644 --- a/app/models/legislation/draft_version.rb +++ b/app/models/legislation/draft_version.rb @@ -1,4 +1,4 @@ -class Legislation::DraftVersion < ActiveRecord::Base +class Legislation::DraftVersion < ApplicationRecord VALID_STATUSES = %w(draft published) acts_as_paranoid column: :hidden_at diff --git a/app/models/legislation/process.rb b/app/models/legislation/process.rb index 46d879b63..3d2c72c27 100644 --- a/app/models/legislation/process.rb +++ b/app/models/legislation/process.rb @@ -1,4 +1,4 @@ -class Legislation::Process < ActiveRecord::Base +class Legislation::Process < ApplicationRecord include ActsAsParanoidAliases include Taggable include Milestoneable diff --git a/app/models/legislation/question.rb b/app/models/legislation/question.rb index acee09088..6c60eb9f3 100644 --- a/app/models/legislation/question.rb +++ b/app/models/legislation/question.rb @@ -1,4 +1,4 @@ -class Legislation::Question < ActiveRecord::Base +class Legislation::Question < ApplicationRecord acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases include Notifiable diff --git a/app/models/legislation/question_option.rb b/app/models/legislation/question_option.rb index f69c60894..c6f846120 100644 --- a/app/models/legislation/question_option.rb +++ b/app/models/legislation/question_option.rb @@ -1,4 +1,4 @@ -class Legislation::QuestionOption < ActiveRecord::Base +class Legislation::QuestionOption < ApplicationRecord acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases diff --git a/app/models/poll.rb b/app/models/poll.rb index e90bf191b..22b2d8902 100644 --- a/app/models/poll.rb +++ b/app/models/poll.rb @@ -1,4 +1,4 @@ -class Poll < ActiveRecord::Base +class Poll < ApplicationRecord include Imageable acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases diff --git a/app/models/poll/answer.rb b/app/models/poll/answer.rb index 8e92988ad..1e602086b 100644 --- a/app/models/poll/answer.rb +++ b/app/models/poll/answer.rb @@ -1,4 +1,4 @@ -class Poll::Answer < ActiveRecord::Base +class Poll::Answer < ApplicationRecord belongs_to :question, -> { with_hidden } belongs_to :author, -> { with_hidden }, class_name: "User", foreign_key: "author_id" diff --git a/app/models/poll/booth.rb b/app/models/poll/booth.rb index 5dfd32a6f..d10270064 100644 --- a/app/models/poll/booth.rb +++ b/app/models/poll/booth.rb @@ -1,5 +1,5 @@ class Poll - class Booth < ActiveRecord::Base + class Booth < ApplicationRecord has_many :booth_assignments, class_name: "Poll::BoothAssignment" has_many :polls, through: :booth_assignments has_many :shifts diff --git a/app/models/poll/booth_assignment.rb b/app/models/poll/booth_assignment.rb index 811b98923..fa037ed21 100644 --- a/app/models/poll/booth_assignment.rb +++ b/app/models/poll/booth_assignment.rb @@ -1,5 +1,5 @@ class Poll - class BoothAssignment < ActiveRecord::Base + class BoothAssignment < ApplicationRecord belongs_to :booth belongs_to :poll diff --git a/app/models/poll/officer.rb b/app/models/poll/officer.rb index ef96cfa91..c44256a5a 100644 --- a/app/models/poll/officer.rb +++ b/app/models/poll/officer.rb @@ -1,5 +1,5 @@ class Poll - class Officer < ActiveRecord::Base + class Officer < ApplicationRecord belongs_to :user has_many :officer_assignments, class_name: "Poll::OfficerAssignment" has_many :shifts, class_name: "Poll::Shift" diff --git a/app/models/poll/officer_assignment.rb b/app/models/poll/officer_assignment.rb index c997c9a5a..5714d8e74 100644 --- a/app/models/poll/officer_assignment.rb +++ b/app/models/poll/officer_assignment.rb @@ -1,5 +1,5 @@ class Poll - class OfficerAssignment < ActiveRecord::Base + class OfficerAssignment < ApplicationRecord belongs_to :officer belongs_to :booth_assignment has_many :ballot_sheets diff --git a/app/models/poll/partial_result.rb b/app/models/poll/partial_result.rb index b24ae9750..7c4a6657e 100644 --- a/app/models/poll/partial_result.rb +++ b/app/models/poll/partial_result.rb @@ -1,4 +1,4 @@ -class Poll::PartialResult < ActiveRecord::Base +class Poll::PartialResult < ApplicationRecord VALID_ORIGINS = %w{web booth} diff --git a/app/models/poll/question.rb b/app/models/poll/question.rb index 3dc19dabb..16cbe69b7 100644 --- a/app/models/poll/question.rb +++ b/app/models/poll/question.rb @@ -1,4 +1,4 @@ -class Poll::Question < ActiveRecord::Base +class Poll::Question < ApplicationRecord include Measurable include Searchable diff --git a/app/models/poll/recount.rb b/app/models/poll/recount.rb index 878b1ee55..9cd744cc0 100644 --- a/app/models/poll/recount.rb +++ b/app/models/poll/recount.rb @@ -1,4 +1,4 @@ -class Poll::Recount < ActiveRecord::Base +class Poll::Recount < ApplicationRecord VALID_ORIGINS = %w{web booth letter}.freeze diff --git a/app/models/poll/voter.rb b/app/models/poll/voter.rb index 1e4a0d204..522c28de2 100644 --- a/app/models/poll/voter.rb +++ b/app/models/poll/voter.rb @@ -1,5 +1,5 @@ class Poll - class Voter < ActiveRecord::Base + class Voter < ApplicationRecord VALID_ORIGINS = %w{web booth}.freeze diff --git a/app/models/signature.rb b/app/models/signature.rb index 3f5729058..9daf8cbe5 100644 --- a/app/models/signature.rb +++ b/app/models/signature.rb @@ -1,4 +1,4 @@ -class Signature < ActiveRecord::Base +class Signature < ApplicationRecord belongs_to :signature_sheet belongs_to :user diff --git a/app/models/signature_sheet.rb b/app/models/signature_sheet.rb index a8a10a150..86aaf8f3d 100644 --- a/app/models/signature_sheet.rb +++ b/app/models/signature_sheet.rb @@ -1,4 +1,4 @@ -class SignatureSheet < ActiveRecord::Base +class SignatureSheet < ApplicationRecord belongs_to :signable, polymorphic: true belongs_to :author, class_name: "User", foreign_key: "author_id" diff --git a/app/models/site_customization/content_block.rb b/app/models/site_customization/content_block.rb index 6903303e7..2219ef5d4 100644 --- a/app/models/site_customization/content_block.rb +++ b/app/models/site_customization/content_block.rb @@ -1,4 +1,4 @@ -class SiteCustomization::ContentBlock < ActiveRecord::Base +class SiteCustomization::ContentBlock < ApplicationRecord VALID_BLOCKS = %w[top_links footer subnavigation_left subnavigation_right] validates :locale, presence: true, inclusion: { in: I18n.available_locales.map(&:to_s) } diff --git a/app/models/site_customization/image.rb b/app/models/site_customization/image.rb index e933c40a0..12a61dad8 100644 --- a/app/models/site_customization/image.rb +++ b/app/models/site_customization/image.rb @@ -1,4 +1,4 @@ -class SiteCustomization::Image < ActiveRecord::Base +class SiteCustomization::Image < ApplicationRecord VALID_IMAGES = { "logo_header" => [260, 80], "social_media_icon" => [470, 246], diff --git a/app/models/site_customization/page.rb b/app/models/site_customization/page.rb index 6dd8f8d2f..11ced8f07 100644 --- a/app/models/site_customization/page.rb +++ b/app/models/site_customization/page.rb @@ -1,4 +1,4 @@ -class SiteCustomization::Page < ActiveRecord::Base +class SiteCustomization::Page < ApplicationRecord VALID_STATUSES = %w[draft published] has_many :cards, class_name: "Widget::Card", foreign_key: "site_customization_page_id" From 01c1ac2b106aeb32809bb5e912a2b38780837e9a Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Thu, 3 May 2018 11:27:48 -0400 Subject: [PATCH 089/104] Replace all occurrences of `ActiveRecord::Base` with `ApplicationRecord` --- app/models/admin_notification.rb | 2 +- app/models/budget/phase.rb | 2 +- app/models/budget/valuator_group_assignment.rb | 2 +- app/models/community.rb | 2 +- app/models/document.rb | 2 +- app/models/follow.rb | 2 +- app/models/image.rb | 2 +- app/models/legislation/proposal.rb | 2 +- app/models/local_census_record.rb | 2 +- app/models/map_location.rb | 2 +- app/models/newsletter.rb | 2 +- app/models/poll/question/answer.rb | 2 +- app/models/poll/question/answer/video.rb | 2 +- app/models/poll/shift.rb | 2 +- app/models/related_content.rb | 2 +- app/models/related_content_score.rb | 2 +- app/models/topic.rb | 2 +- app/models/valuator_group.rb | 2 +- 18 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/models/admin_notification.rb b/app/models/admin_notification.rb index 6fc3e83e3..5e86f3d28 100644 --- a/app/models/admin_notification.rb +++ b/app/models/admin_notification.rb @@ -1,4 +1,4 @@ -class AdminNotification < ActiveRecord::Base +class AdminNotification < ApplicationRecord include Notifiable translates :title, touch: true diff --git a/app/models/budget/phase.rb b/app/models/budget/phase.rb index 2c50c10e8..5912a1453 100644 --- a/app/models/budget/phase.rb +++ b/app/models/budget/phase.rb @@ -1,5 +1,5 @@ class Budget - class Phase < ActiveRecord::Base + class Phase < ApplicationRecord PHASE_KINDS = %w(drafting informing accepting reviewing selecting valuating publishing_prices balloting reviewing_ballots finished).freeze PUBLISHED_PRICES_PHASES = %w(publishing_prices balloting reviewing_ballots finished).freeze diff --git a/app/models/budget/valuator_group_assignment.rb b/app/models/budget/valuator_group_assignment.rb index 88a04ae1a..3aa93cb14 100644 --- a/app/models/budget/valuator_group_assignment.rb +++ b/app/models/budget/valuator_group_assignment.rb @@ -1,5 +1,5 @@ class Budget - class ValuatorGroupAssignment < ActiveRecord::Base + class ValuatorGroupAssignment < ApplicationRecord belongs_to :valuator_group, counter_cache: :budget_investments_count belongs_to :investment, counter_cache: true end diff --git a/app/models/community.rb b/app/models/community.rb index c9dd0ddfb..b41dd45fc 100644 --- a/app/models/community.rb +++ b/app/models/community.rb @@ -1,4 +1,4 @@ -class Community < ActiveRecord::Base +class Community < ApplicationRecord has_one :proposal has_one :investment, class_name: Budget::Investment has_many :topics diff --git a/app/models/document.rb b/app/models/document.rb index e8524bc72..e1dd94ceb 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -1,4 +1,4 @@ -class Document < ActiveRecord::Base +class Document < ApplicationRecord include DocumentsHelper include DocumentablesHelper has_attached_file :attachment, url: "/system/:class/:prefix/:style/:hash.:extension", diff --git a/app/models/follow.rb b/app/models/follow.rb index 51628f7d4..8062ffecc 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -1,4 +1,4 @@ -class Follow < ActiveRecord::Base +class Follow < ApplicationRecord belongs_to :user belongs_to :followable, polymorphic: true diff --git a/app/models/image.rb b/app/models/image.rb index a782d1916..ce8e750ef 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -1,4 +1,4 @@ -class Image < ActiveRecord::Base +class Image < ApplicationRecord include ImagesHelper include ImageablesHelper diff --git a/app/models/legislation/proposal.rb b/app/models/legislation/proposal.rb index 0e1a39c90..16ab2d7dd 100644 --- a/app/models/legislation/proposal.rb +++ b/app/models/legislation/proposal.rb @@ -1,4 +1,4 @@ -class Legislation::Proposal < ActiveRecord::Base +class Legislation::Proposal < ApplicationRecord include ActsAsParanoidAliases include Flaggable include Taggable diff --git a/app/models/local_census_record.rb b/app/models/local_census_record.rb index 1c2c42d44..d275ec130 100644 --- a/app/models/local_census_record.rb +++ b/app/models/local_census_record.rb @@ -1,4 +1,4 @@ -class LocalCensusRecord < ActiveRecord::Base +class LocalCensusRecord < ApplicationRecord validates :document_number, presence: true validates :document_type, presence: true validates :date_of_birth, presence: true diff --git a/app/models/map_location.rb b/app/models/map_location.rb index 892ba8f20..d69c97ea3 100644 --- a/app/models/map_location.rb +++ b/app/models/map_location.rb @@ -1,4 +1,4 @@ -class MapLocation < ActiveRecord::Base +class MapLocation < ApplicationRecord belongs_to :proposal, touch: true belongs_to :investment, class_name: Budget::Investment, touch: true diff --git a/app/models/newsletter.rb b/app/models/newsletter.rb index 35ed57b91..bac4d8ef7 100644 --- a/app/models/newsletter.rb +++ b/app/models/newsletter.rb @@ -1,4 +1,4 @@ -class Newsletter < ActiveRecord::Base +class Newsletter < ApplicationRecord has_many :activities, as: :actionable validates :subject, presence: true diff --git a/app/models/poll/question/answer.rb b/app/models/poll/question/answer.rb index 2efa2b824..f3eb0c97e 100644 --- a/app/models/poll/question/answer.rb +++ b/app/models/poll/question/answer.rb @@ -1,4 +1,4 @@ -class Poll::Question::Answer < ActiveRecord::Base +class Poll::Question::Answer < ApplicationRecord include Galleryable include Documentable diff --git a/app/models/poll/question/answer/video.rb b/app/models/poll/question/answer/video.rb index 4804f5188..f7b9e9676 100644 --- a/app/models/poll/question/answer/video.rb +++ b/app/models/poll/question/answer/video.rb @@ -1,4 +1,4 @@ -class Poll::Question::Answer::Video < ActiveRecord::Base +class Poll::Question::Answer::Video < ApplicationRecord belongs_to :answer, class_name: "Poll::Question::Answer", foreign_key: "answer_id" VIMEO_REGEX = /vimeo.*(staffpicks\/|channels\/|videos\/|video\/|\/)([^#\&\?]*).*/ diff --git a/app/models/poll/shift.rb b/app/models/poll/shift.rb index dd5c1db32..828fba66e 100644 --- a/app/models/poll/shift.rb +++ b/app/models/poll/shift.rb @@ -1,5 +1,5 @@ class Poll - class Shift < ActiveRecord::Base + class Shift < ApplicationRecord belongs_to :booth belongs_to :officer diff --git a/app/models/related_content.rb b/app/models/related_content.rb index f9facb47a..4a74ba3c7 100644 --- a/app/models/related_content.rb +++ b/app/models/related_content.rb @@ -1,4 +1,4 @@ -class RelatedContent < ActiveRecord::Base +class RelatedContent < ApplicationRecord RELATED_CONTENT_SCORE_THRESHOLD = Setting["related_content_score_threshold"].to_f RELATIONABLE_MODELS = %w{proposals debates budgets investments}.freeze diff --git a/app/models/related_content_score.rb b/app/models/related_content_score.rb index da37fc07d..3d7684545 100644 --- a/app/models/related_content_score.rb +++ b/app/models/related_content_score.rb @@ -1,4 +1,4 @@ -class RelatedContentScore < ActiveRecord::Base +class RelatedContentScore < ApplicationRecord SCORES = { POSITIVE: 1, NEGATIVE: -1 diff --git a/app/models/topic.rb b/app/models/topic.rb index e9e463aa5..8130c03da 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -1,4 +1,4 @@ -class Topic < ActiveRecord::Base +class Topic < ApplicationRecord acts_as_paranoid column: :hidden_at include ActsAsParanoidAliases include Notifiable diff --git a/app/models/valuator_group.rb b/app/models/valuator_group.rb index 26738b542..9e8d388b5 100644 --- a/app/models/valuator_group.rb +++ b/app/models/valuator_group.rb @@ -1,4 +1,4 @@ -class ValuatorGroup < ActiveRecord::Base +class ValuatorGroup < ApplicationRecord has_many :valuators has_many :valuator_group_assignments, dependent: :destroy, class_name: "Budget::ValuatorGroupAssignment" has_many :investments, through: :valuator_group_assignments, class_name: "Budget::Investment" From 26b213c1868bff111305d0e756785fbfecc93073 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Mon, 7 May 2018 09:05:05 -0400 Subject: [PATCH 090/104] Use Legislation::BaseController on instead of ApplicationController --- app/controllers/legislation/annotations_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/legislation/annotations_controller.rb b/app/controllers/legislation/annotations_controller.rb index 587a9578e..a25248032 100644 --- a/app/controllers/legislation/annotations_controller.rb +++ b/app/controllers/legislation/annotations_controller.rb @@ -1,4 +1,4 @@ -class Legislation::AnnotationsController < ApplicationController +class Legislation::AnnotationsController < Legislation::BaseController skip_before_action :verify_authenticity_token before_action :authenticate_user!, only: [:create, :new_comment] From 129411864e5ec3a5fa759c4e581171b7ba0b6c3e Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Tue, 7 Aug 2018 15:23:22 -0400 Subject: [PATCH 091/104] Replace occurrences of ActiveRecord::Base on new models --- app/models/banner/section.rb | 2 +- app/models/i18n_content.rb | 2 +- app/models/i18n_content_translation.rb | 2 +- app/models/web_section.rb | 2 +- app/models/widget/card.rb | 2 +- app/models/widget/feed.rb | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/banner/section.rb b/app/models/banner/section.rb index 493093731..5a09aaf36 100644 --- a/app/models/banner/section.rb +++ b/app/models/banner/section.rb @@ -1,4 +1,4 @@ -class Banner::Section < ActiveRecord::Base +class Banner::Section < ApplicationRecord belongs_to :banner belongs_to :web_section end diff --git a/app/models/i18n_content.rb b/app/models/i18n_content.rb index 81c4ebee7..173c7310a 100644 --- a/app/models/i18n_content.rb +++ b/app/models/i18n_content.rb @@ -1,4 +1,4 @@ -class I18nContent < ActiveRecord::Base +class I18nContent < ApplicationRecord scope :by_key, ->(key) { where(key: key) } scope :begins_with_key, ->(key) { where("key ILIKE ?", "#{key}%") } diff --git a/app/models/i18n_content_translation.rb b/app/models/i18n_content_translation.rb index 2d6fb2b2b..4e754a3a5 100644 --- a/app/models/i18n_content_translation.rb +++ b/app/models/i18n_content_translation.rb @@ -1,4 +1,4 @@ -class I18nContentTranslation < ActiveRecord::Base +class I18nContentTranslation < ApplicationRecord def self.existing_languages self.select(:locale).distinct.map { |l| l.locale.to_sym }.to_a end diff --git a/app/models/web_section.rb b/app/models/web_section.rb index ffeca96f2..3c2dd5790 100644 --- a/app/models/web_section.rb +++ b/app/models/web_section.rb @@ -1,4 +1,4 @@ -class WebSection < ActiveRecord::Base +class WebSection < ApplicationRecord has_many :sections has_many :banners, through: :sections end diff --git a/app/models/widget/card.rb b/app/models/widget/card.rb index 5ec0d4944..bbc87e33b 100644 --- a/app/models/widget/card.rb +++ b/app/models/widget/card.rb @@ -1,4 +1,4 @@ -class Widget::Card < ActiveRecord::Base +class Widget::Card < ApplicationRecord include Imageable belongs_to :page, class_name: "SiteCustomization::Page", foreign_key: "site_customization_page_id" diff --git a/app/models/widget/feed.rb b/app/models/widget/feed.rb index 997f9e8b6..2ddd00d62 100644 --- a/app/models/widget/feed.rb +++ b/app/models/widget/feed.rb @@ -1,4 +1,4 @@ -class Widget::Feed < ActiveRecord::Base +class Widget::Feed < ApplicationRecord self.table_name = "widget_feeds" KINDS = %w(proposals debates processes) From 4b57c3d8eb29e8ed26b96056caf6c7367897c491 Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Sat, 23 Mar 2019 12:12:23 +0100 Subject: [PATCH 092/104] Replace occurrences of ActiveRecord::Base on new models --- app/models/active_poll.rb | 2 +- app/models/budget/content_block.rb | 2 +- app/models/ckeditor/asset.rb | 2 +- app/models/milestone.rb | 2 +- app/models/milestone/status.rb | 2 +- app/models/progress_bar.rb | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/models/active_poll.rb b/app/models/active_poll.rb index 50e185ea5..040a33451 100644 --- a/app/models/active_poll.rb +++ b/app/models/active_poll.rb @@ -1,4 +1,4 @@ -class ActivePoll < ActiveRecord::Base +class ActivePoll < ApplicationRecord include Measurable translates :description, touch: true diff --git a/app/models/budget/content_block.rb b/app/models/budget/content_block.rb index bba830cec..ae3bf44e9 100644 --- a/app/models/budget/content_block.rb +++ b/app/models/budget/content_block.rb @@ -1,5 +1,5 @@ class Budget - class ContentBlock < ActiveRecord::Base + class ContentBlock < ApplicationRecord validates :locale, presence: true, inclusion: { in: I18n.available_locales.map(&:to_s) } validates :heading, presence: true validates_uniqueness_of :heading, scope: :locale diff --git a/app/models/ckeditor/asset.rb b/app/models/ckeditor/asset.rb index cf636ed19..5c166fdfc 100644 --- a/app/models/ckeditor/asset.rb +++ b/app/models/ckeditor/asset.rb @@ -1,4 +1,4 @@ -class Ckeditor::Asset < ActiveRecord::Base +class Ckeditor::Asset < ApplicationRecord include Ckeditor::Orm::ActiveRecord::AssetBase include Ckeditor::Backend::Paperclip end diff --git a/app/models/milestone.rb b/app/models/milestone.rb index 124e05870..69d46149a 100644 --- a/app/models/milestone.rb +++ b/app/models/milestone.rb @@ -1,4 +1,4 @@ -class Milestone < ActiveRecord::Base +class Milestone < ApplicationRecord include Imageable include Documentable documentable max_documents_allowed: 3, diff --git a/app/models/milestone/status.rb b/app/models/milestone/status.rb index 51b03427d..5f99cac22 100644 --- a/app/models/milestone/status.rb +++ b/app/models/milestone/status.rb @@ -1,4 +1,4 @@ -class Milestone::Status < ActiveRecord::Base +class Milestone::Status < ApplicationRecord acts_as_paranoid column: :hidden_at has_many :milestones diff --git a/app/models/progress_bar.rb b/app/models/progress_bar.rb index e739e4243..c0bacc7ba 100644 --- a/app/models/progress_bar.rb +++ b/app/models/progress_bar.rb @@ -1,4 +1,4 @@ -class ProgressBar < ActiveRecord::Base +class ProgressBar < ApplicationRecord self.inheritance_column = nil RANGE = 0..100 From 83e129d5b785c516d66651e249aa1220ca280274 Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Sun, 31 Mar 2019 15:48:54 +0200 Subject: [PATCH 093/104] Fix failing tests If tests run very fast all votes are created within the last 24 hours, so hot_score has the same value if the creation date for the votes is Time.current or 1.day.ago. Creating the votes 48 hours ago we make sure hot_score has the correct value and the tests pass correctly. --- spec/models/debate_spec.rb | 2 +- spec/models/legislation/proposal_spec.rb | 2 +- spec/models/proposal_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/models/debate_spec.rb b/spec/models/debate_spec.rb index 12da638ee..8f4745007 100644 --- a/spec/models/debate_spec.rb +++ b/spec/models/debate_spec.rb @@ -273,7 +273,7 @@ describe Debate do newer_debate = create(:debate, created_at: now) 5.times { newer_debate.vote_by(voter: create(:user), vote: "yes") } - older_debate = create(:debate, created_at: 1.day.ago) + older_debate = create(:debate, created_at: 2.days.ago) 5.times { older_debate.vote_by(voter: create(:user), vote: "yes") } expect(newer_debate.hot_score).to be > older_debate.hot_score diff --git a/spec/models/legislation/proposal_spec.rb b/spec/models/legislation/proposal_spec.rb index 28ea9c72d..f2f72b055 100644 --- a/spec/models/legislation/proposal_spec.rb +++ b/spec/models/legislation/proposal_spec.rb @@ -67,7 +67,7 @@ describe Legislation::Proposal do newer_proposal = create(:legislation_proposal, created_at: now) 5.times { newer_proposal.vote_by(voter: create(:user), vote: "yes") } - older_proposal = create(:legislation_proposal, created_at: 1.day.ago) + older_proposal = create(:legislation_proposal, created_at: 2.day.ago) 5.times { older_proposal.vote_by(voter: create(:user), vote: "yes") } expect(newer_proposal.hot_score).to be > older_proposal.hot_score diff --git a/spec/models/proposal_spec.rb b/spec/models/proposal_spec.rb index 334eee502..3f08f011a 100644 --- a/spec/models/proposal_spec.rb +++ b/spec/models/proposal_spec.rb @@ -291,7 +291,7 @@ describe Proposal do newer_proposal = create(:proposal, created_at: now) 5.times { newer_proposal.vote_by(voter: create(:user), vote: "yes") } - older_proposal = create(:proposal, created_at: 1.day.ago) + older_proposal = create(:proposal, created_at: 2.days.ago) 5.times { older_proposal.vote_by(voter: create(:user), vote: "yes") } expect(newer_proposal.hot_score).to be > older_proposal.hot_score From 6e88031537c0279dc79da267f7f9e8ffa8dc51eb Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Sat, 30 Mar 2019 19:02:37 +0100 Subject: [PATCH 094/104] Fix several rubocop warnings Metrics/LineLength: Line is too long. RSpec/InstanceVariable: Use let instead of an instance variable. Layout/TrailingBlankLines: Final newline missing. Style/StringLiterals: Prefer double-quoted strings. --- Gemfile | 2 +- app/models/application_record.rb | 2 +- app/models/concerns/sanitizable.rb | 3 +- app/models/document.rb | 8 +- app/models/image.rb | 7 +- app/models/user.rb | 4 +- config/environments/development.rb | 2 +- config/initializers/acts_as_taggable_on.rb | 5 +- spec/controllers/comments_controller_spec.rb | 53 +++-- spec/controllers/debates_controller_spec.rb | 8 +- spec/controllers/graphql_controller_spec.rb | 6 +- .../annotations_controller_spec.rb | 182 +++++++++++------- .../legislation/answers_controller_spec.rb | 50 +++-- .../management/sessions_controller_spec.rb | 12 +- 14 files changed, 230 insertions(+), 114 deletions(-) diff --git a/Gemfile b/Gemfile index 95e998ae5..c9143b64a 100644 --- a/Gemfile +++ b/Gemfile @@ -40,7 +40,7 @@ gem "paperclip", "~> 5.2.1" gem "paranoia", "~> 2.4.1" gem "pg", "~> 0.21.0" gem "pg_search", "~> 2.0.1" -gem 'record_tag_helper', '~> 1.0' +gem "record_tag_helper", "~> 1.0" gem "redcarpet", "~> 3.4.0" gem "responders", "~> 2.4.0" gem "rinku", "~> 2.0.2", require: "rails_rinku" diff --git a/app/models/application_record.rb b/app/models/application_record.rb index 71a1a03cc..10a4cba84 100644 --- a/app/models/application_record.rb +++ b/app/models/application_record.rb @@ -1,3 +1,3 @@ class ApplicationRecord < ActiveRecord::Base self.abstract_class = true -end \ No newline at end of file +end diff --git a/app/models/concerns/sanitizable.rb b/app/models/concerns/sanitizable.rb index fc296c4b5..8602257ef 100644 --- a/app/models/concerns/sanitizable.rb +++ b/app/models/concerns/sanitizable.rb @@ -27,7 +27,8 @@ module Sanitizable end def translatable_description? - self.class.included_modules.include?(Globalizable) && self.class.translated_attribute_names.include?(:description) + self.class.included_modules.include?(Globalizable) && + self.class.translated_attribute_names.include?(:description) end def sanitize_description_translations diff --git a/app/models/document.rb b/app/models/document.rb index e1dd94ceb..3a78231f1 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -89,9 +89,11 @@ class Document < ApplicationRecord def validate_attachment_content_type if documentable_class && !accepted_content_types(documentable_class).include?(attachment_content_type) - errors.add(:attachment, I18n.t("documents.errors.messages.wrong_content_type", - content_type: attachment_content_type, - accepted_content_types: documentable_humanized_accepted_content_types(documentable_class))) + accepted_content_types = documentable_humanized_accepted_content_types(documentable_class) + message = I18n.t("documents.errors.messages.wrong_content_type", + content_type: attachment_content_type, + accepted_content_types: accepted_content_types) + errors.add(:attachment, message) end end diff --git a/app/models/image.rb b/app/models/image.rb index ce8e750ef..eefcd3926 100644 --- a/app/models/image.rb +++ b/app/models/image.rb @@ -87,9 +87,10 @@ class Image < ApplicationRecord def validate_attachment_content_type if imageable_class && !attachment_of_valid_content_type? - errors.add(:attachment, I18n.t("images.errors.messages.wrong_content_type", - content_type: attachment_content_type, - accepted_content_types: imageable_humanized_accepted_content_types)) + message = I18n.t("images.errors.messages.wrong_content_type", + content_type: attachment_content_type, + accepted_content_types: imageable_humanized_accepted_content_types) + errors.add(:attachment, message) end end diff --git a/app/models/user.rb b/app/models/user.rb index 4dcba1c6f..35bff958a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -128,7 +128,9 @@ class User < ApplicationRecord end def headings_voted_within_group(group) - Budget::Heading.joins(:translations).order("name").where(id: voted_investments.by_group(group).pluck(:heading_id)) + Budget::Heading.joins(:translations) + .order("name") + .where(id: voted_investments.by_group(group).pluck(:heading_id)) end def voted_investments diff --git a/config/environments/development.rb b/config/environments/development.rb index 4888def4b..fc032e333 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -13,7 +13,7 @@ Rails.application.configure do config.consider_all_requests_local = true # Enable/disable caching. By default caching is disabled. - if Rails.root.join('tmp/caching-dev.txt').exist? + if Rails.root.join("tmp/caching-dev.txt").exist? config.action_controller.perform_caching = true config.cache_store = :memory_store diff --git a/config/initializers/acts_as_taggable_on.rb b/config/initializers/acts_as_taggable_on.rb index d7510e9c6..d8ebeeec5 100644 --- a/config/initializers/acts_as_taggable_on.rb +++ b/config/initializers/acts_as_taggable_on.rb @@ -74,7 +74,10 @@ module ActsAsTaggableOn end def self.spending_proposal_tags - ActsAsTaggableOn::Tag.where("taggings.taggable_type" => "SpendingProposal").includes(:taggings).order(:name).distinct + ActsAsTaggableOn::Tag.where("taggings.taggable_type" => "SpendingProposal") + .includes(:taggings) + .order(:name) + .distinct end def self.graphql_field_name diff --git a/spec/controllers/comments_controller_spec.rb b/spec/controllers/comments_controller_spec.rb index 6fbcd3c7c..02f1d5c6e 100644 --- a/spec/controllers/comments_controller_spec.rb +++ b/spec/controllers/comments_controller_spec.rb @@ -3,36 +3,57 @@ require "rails_helper" describe CommentsController do describe "POST create" do - before do - @process = create(:legislation_process, debate_start_date: Date.current - 3.days, debate_end_date: Date.current + 2.days) - @question = create(:legislation_question, process: @process, title: "Question 1") - @user = create(:user, :level_two) - @unverified_user = create(:user) - end + + let(:legal_process) { create(:legislation_process, debate_start_date: Date.current - 3.days, + debate_end_date: Date.current + 2.days) } + let(:question) { create(:legislation_question, process: legal_process, title: "Question 1") } + let(:user) { create(:user, :level_two) } + let(:unverified_user) { create(:user) } it "creates an comment if the comments are open" do - sign_in @user + sign_in user expect do - post :create, params: {comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}}, xhr: true - end.to change { @question.reload.comments_count }.by(1) + post :create, xhr: true, + params: { + comment: { + commentable_id: question.id, + commentable_type: "Legislation::Question", + body: "a comment" + } + } + end.to change { question.reload.comments_count }.by(1) end it "does not create a comment if the comments are closed" do - sign_in @user - @process.update_attribute(:debate_end_date, Date.current - 1.day) + sign_in user + legal_process.update_attribute(:debate_end_date, Date.current - 1.day) expect do - post :create, params: {comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}}, xhr: true - end.not_to change { @question.reload.comments_count } + post :create, xhr: true, + params: { + comment: { + commentable_id: question.id, + commentable_type: "Legislation::Question", + body: "a comment" + } + } + end.not_to change { question.reload.comments_count } end it "does not create a comment for unverified users when the commentable requires it" do - sign_in @unverified_user + sign_in unverified_user expect do - post :create, params: {comment: {commentable_id: @question.id, commentable_type: "Legislation::Question", body: "a comment"}}, xhr: true - end.not_to change { @question.reload.comments_count } + post :create, xhr: true, + params: { + comment: { + commentable_id: question.id, + commentable_type: "Legislation::Question", + body: "a comment" + } + } + end.not_to change { question.reload.comments_count } end end end diff --git a/spec/controllers/debates_controller_spec.rb b/spec/controllers/debates_controller_spec.rb index ad1d66bf2..60c977689 100644 --- a/spec/controllers/debates_controller_spec.rb +++ b/spec/controllers/debates_controller_spec.rb @@ -15,7 +15,13 @@ describe DebatesController do sign_in create(:user) - post :create, params: { debate: { title: "A sample debate", description: "this is a sample debate", terms_of_service: 1 }} + post :create, params: { + debate: { + title: "A sample debate", + description: "this is a sample debate", + terms_of_service: 1 + } + } expect(Ahoy::Event.where(name: :debate_created).count).to eq 1 expect(Ahoy::Event.last.properties["debate_id"]).to eq Debate.last.id end diff --git a/spec/controllers/graphql_controller_spec.rb b/spec/controllers/graphql_controller_spec.rb index c975ec160..b55816e39 100644 --- a/spec/controllers/graphql_controller_spec.rb +++ b/spec/controllers/graphql_controller_spec.rb @@ -38,7 +38,8 @@ describe GraphqlController, type: :request do let(:json_headers) { { "CONTENT_TYPE" => "application/json" } } specify "with json-encoded query string inside body" do - post "/graphql", params: { query: "{ proposal(id: #{proposal.id}) { title } }" }.to_json, headers: json_headers + post "/graphql", params: { query: "{ proposal(id: #{proposal.id}) { title } }" }.to_json, + headers: json_headers expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)["data"]["proposal"]["title"]).to eq(proposal.title) @@ -46,7 +47,8 @@ describe GraphqlController, type: :request do specify "with raw query string inside body" do graphql_headers = { "CONTENT_TYPE" => "application/graphql" } - post "/graphql", params: "{ proposal(id: #{proposal.id}) { title } }", headers: graphql_headers + post "/graphql", params: "{ proposal(id: #{proposal.id}) { title } }", + headers: graphql_headers expect(response).to have_http_status(:ok) expect(JSON.parse(response.body)["data"]["proposal"]["title"]).to eq(proposal.title) diff --git a/spec/controllers/legislation/annotations_controller_spec.rb b/spec/controllers/legislation/annotations_controller_spec.rb index 1b7f6cac0..7e580b3c8 100644 --- a/spec/controllers/legislation/annotations_controller_spec.rb +++ b/spec/controllers/legislation/annotations_controller_spec.rb @@ -3,109 +3,161 @@ require "rails_helper" describe Legislation::AnnotationsController do describe "POST create" do - before do - @process = create(:legislation_process, allegations_start_date: Date.current - 3.days, allegations_end_date: Date.current + 2.days) - @draft_version = create(:legislation_draft_version, :published, process: @process, title: "Version 1") - @final_version = create(:legislation_draft_version, :published, :final_version, process: @process, title: "Final version") - @user = create(:user, :level_two) - end + + let(:legal_process) { create(:legislation_process, + allegations_start_date: Date.current - 3.days, + allegations_end_date: Date.current + 2.days) } + let(:draft_version) { create(:legislation_draft_version, :published, + process: legal_process, + title: "Version 1") } + let(:final_version) { create(:legislation_draft_version, :published, + :final_version, + process: legal_process, + title: "Final version") } + let(:user) { create(:user, :level_two) } + it "creates an ahoy event" do - sign_in @user + sign_in user post :create, params: { - process_id: @process.id, - draft_version_id: @draft_version.id, + process_id: legal_process.id, + draft_version_id: draft_version.id, legislation_annotation: { - "quote"=>"ipsum", - "ranges"=>[{"start"=>"/p[1]", "startOffset"=>6, "end"=>"/p[1]", "endOffset"=>11}], - "text": "una anotacion" - }} + "quote" => "ipsum", + "ranges" => [{ + "start" => "/p[1]", + "startOffset" => 6, + "end" => "/p[1]", + "endOffset" => 11 + }], + "text" => "una anotacion" + } + } expect(Ahoy::Event.where(name: :legislation_annotation_created).count).to eq 1 expect(Ahoy::Event.last.properties["legislation_annotation_id"]).to eq Legislation::Annotation.last.id end it "does not create an annotation if the draft version is a final version" do - sign_in @user + sign_in user post :create, params: { - process_id: @process.id, - draft_version_id: @final_version.id, - legislation_annotation: { - "quote" => "ipsum", - "ranges" => [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}], - "text": "una anotacion" - }} + process_id: legal_process.id, + draft_version_id: final_version.id, + legislation_annotation: { + "quote" => "ipsum", + "ranges" => [{ + "start" => "/p[1]", + "startOffset" => 6, + "end" => "/p[1]", + "endOffset" => 11 + }], + "text" => "una anotacion" + } + } expect(response).to have_http_status(:not_found) end it "creates an annotation if the process allegations phase is open" do - sign_in @user + sign_in user expect do - post :create, params: { - process_id: @process.id, - draft_version_id: @draft_version.id, + post :create, xhr: true, + params: { + process_id: legal_process.id, + draft_version_id: draft_version.id, legislation_annotation: { - "quote"=>"ipsum", - "ranges"=>[{"start"=>"/p[1]", "startOffset"=>6, "end"=>"/p[1]", "endOffset"=>11}], - "text": "una anotacion" - }}, - xhr: true - end.to change { @draft_version.annotations.count }.by(1) + "quote" => "ipsum", + "ranges" => [{ + "start" => "/p[1]", + "startOffset" => 6, + "end" => "/p[1]", + "endOffset" => 11 + }], + "text" => "una anotacion" + } + } + end.to change { draft_version.annotations.count }.by(1) end it "does not create an annotation if the process allegations phase is not open" do - sign_in @user - @process.update_attribute(:allegations_end_date, Date.current - 1.day) + sign_in user + legal_process.update_attribute(:allegations_end_date, Date.current - 1.day) expect do - post :create, params: { - process_id: @process.id, - draft_version_id: @draft_version.id, + post :create, xhr: true, + params: { + process_id: legal_process.id, + draft_version_id: draft_version.id, legislation_annotation: { - "quote"=>"ipsum", - "ranges"=>[{"start"=>"/p[1]", "startOffset"=>6, "end"=>"/p[1]", "endOffset"=>11}], - "text": "una anotacion" - }}, - xhr: true - end.to_not change { @draft_version.annotations.count } + "quote" => "ipsum", + "ranges"=> [{ + "start" => "/p[1]", + "startOffset" => 6, + "end" => "/p[1]", + "endOffset" => 11 + }], + "text" => "una anotacion" + } + } + end.to_not change { draft_version.annotations.count } end it "creates an annotation by parsing parameters in JSON" do - sign_in @user + sign_in user expect do - post :create, params: { - process_id: @process.id, - draft_version_id: @draft_version.id, + post :create, xhr: true, + params: { + process_id: legal_process.id, + draft_version_id: draft_version.id, legislation_annotation: { - "quote"=>"ipsum", - "ranges"=>[{"start"=>"/p[1]", "startOffset"=>6, "end"=>"/p[1]", "endOffset"=>11}].to_json, - "text": "una anotacion" - }}, - xhr: true - end.to change { @draft_version.annotations.count }.by(1) + "quote" => "ipsum", + "ranges" => [{ + "start" => "/p[1]", + "startOffset" => 6, + "end" => "/p[1]", + "endOffset" => 11 + }].to_json, + "text" => "una anotacion" + } + } + end.to change { draft_version.annotations.count }.by(1) end it "creates a new comment on an existing annotation when range is the same" do - annotation = create(:legislation_annotation, draft_version: @draft_version, text: "my annotation", - ranges: [{"start" => "/p[1]", "startOffset" => 6, "end" => "/p[1]", "endOffset" => 11}], - range_start: "/p[1]", range_start_offset: 6, range_end: "/p[1]", range_end_offset: 11) - sign_in @user + annotation = create(:legislation_annotation, draft_version: draft_version, + text: "my annotation", + ranges: [{ + "start" => "/p[1]", + "startOffset" => 6, + "end" => "/p[1]", + "endOffset" => 11 + }], + range_start: "/p[1]", + range_start_offset: 6, + range_end: "/p[1]", + range_end_offset: 11) + sign_in user expect do - post :create, params: { - process_id: @process.id, - draft_version_id: @draft_version.id, + post :create, xhr: true, + params: { + process_id: legal_process.id, + draft_version_id: draft_version.id, legislation_annotation: { - "quote"=>"ipsum", - "ranges"=>[{"start"=>"/p[1]", "startOffset"=>6, "end"=>"/p[1]", "endOffset"=>11}], - "text": "una anotacion" - }}, - xhr: true - end.to_not change { @draft_version.annotations.count } + "quote" => "ipsum", + "ranges" => [{ + "start" => "/p[1]", + "startOffset" => 6, + "end" => "/p[1]", + "endOffset" => 11 + }], + "text" => "una anotacion" + } + } + end.to_not change { draft_version.annotations.count } expect(annotation.reload.comments_count).to eq(2) expect(annotation.comments.last.body).to eq("una anotacion") diff --git a/spec/controllers/legislation/answers_controller_spec.rb b/spec/controllers/legislation/answers_controller_spec.rb index 3f2e0955f..0388572cb 100644 --- a/spec/controllers/legislation/answers_controller_spec.rb +++ b/spec/controllers/legislation/answers_controller_spec.rb @@ -3,36 +3,56 @@ require "rails_helper" describe Legislation::AnswersController do describe "POST create" do - before do - @process = create(:legislation_process, debate_start_date: Date.current - 3.days, debate_end_date: Date.current + 2.days) - @question = create(:legislation_question, process: @process, title: "Question 1") - @question_option = create(:legislation_question_option, question: @question, value: "Yes") - @user = create(:user, :level_two) - end + + let(:legal_process) { create(:legislation_process, debate_start_date: Date.current - 3.days, + debate_end_date: Date.current + 2.days) } + let(:question) { create(:legislation_question, process: legal_process, title: "Question 1") } + let(:question_option) { create(:legislation_question_option, question: question, value: "Yes") } + let(:user) { create(:user, :level_two) } it "creates an ahoy event" do - sign_in @user + sign_in user - post :create, params: {process_id: @process.id, question_id: @question.id, legislation_answer: { legislation_question_option_id: @question_option.id }} + post :create, params: { + process_id: legal_process.id, + question_id: question.id, + legislation_answer: { + legislation_question_option_id: question_option.id + } + } expect(Ahoy::Event.where(name: :legislation_answer_created).count).to eq 1 expect(Ahoy::Event.last.properties["legislation_answer_id"]).to eq Legislation::Answer.last.id end it "creates an answer if the process debate phase is open" do - sign_in @user + sign_in user expect do - post :create, params: {process_id: @process.id, question_id: @question.id, legislation_answer: { legislation_question_option_id: @question_option.id }}, xhr: true - end.to change { @question.reload.answers_count }.by(1) + post :create, xhr: true, + params: { + process_id: legal_process.id, + question_id: question.id, + legislation_answer: { + legislation_question_option_id: question_option.id + } + } + end.to change { question.reload.answers_count }.by(1) end it "does not create an answer if the process debate phase is not open" do - sign_in @user - @process.update_attribute(:debate_end_date, Date.current - 1.day) + sign_in user + legal_process.update_attribute(:debate_end_date, Date.current - 1.day) expect do - post :create, params: {process_id: @process.id, question_id: @question.id, legislation_answer: { legislation_question_option_id: @question_option.id }}, xhr: true - end.not_to change { @question.reload.answers_count } + post :create, xhr: true, + params: { + process_id: legal_process.id, + question_id: question.id, + legislation_answer: { + legislation_question_option_id: question_option.id + } + } + end.not_to change { question.reload.answers_count } end end end diff --git a/spec/controllers/management/sessions_controller_spec.rb b/spec/controllers/management/sessions_controller_spec.rb index 979fa3f8c..650f53246 100644 --- a/spec/controllers/management/sessions_controller_spec.rb +++ b/spec/controllers/management/sessions_controller_spec.rb @@ -5,7 +5,9 @@ describe Management::SessionsController do describe "Sign in" do it "denies access if wrong manager credentials" do allow_any_instance_of(ManagerAuthenticator).to receive(:auth).and_return(false) - expect { get :create, params: { login: "nonexistent" , clave_usuario: "wrong" }}.to raise_error CanCan::AccessDenied + expect { + get :create, params: { login: "nonexistent", clave_usuario: "wrong" } + }.to raise_error CanCan::AccessDenied expect(session[:manager]).to be_nil end @@ -13,7 +15,11 @@ describe Management::SessionsController do manager = {login: "JJB033", user_key: "31415926", date: "20151031135905"} allow_any_instance_of(ManagerAuthenticator).to receive(:auth).and_return(manager) - get :create, params: { login: "JJB033" , clave_usuario: "31415926", fecha_conexion: "20151031135905" } + get :create, params: { + login: "JJB033" , + clave_usuario: "31415926", + fecha_conexion: "20151031135905" + } expect(response).to be_redirect expect(session[:manager][:login]).to eq "JJB033" end @@ -56,4 +62,4 @@ describe Management::SessionsController do end end -end \ No newline at end of file +end From 9f97b87304552d4690a230306de7ad95d09ef30f Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Sun, 31 Mar 2019 18:45:20 +0200 Subject: [PATCH 095/104] Upgrade gem devise to version 4.6.2 There was a security vulnerability with previous version https://github.com/plataformatec/devise/issues/4981 --- Gemfile | 2 +- Gemfile.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index c9143b64a..c7b49ad24 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ gem "coffee-rails", "~> 4.2.2" gem "daemons", "~> 1.2.4" gem "dalli", "~> 2.7.6" gem "delayed_job_active_record", "~> 4.1.3" -gem "devise", "~> 4.3.0" +gem "devise", "~> 4.6.0" gem "devise-async", "~> 1.0.0" gem "devise_security_extension", git: "https://github.com/phatworx/devise_security_extension.git" #, "~> 0.10" gem "foundation-rails", "~> 6.4.3.0" diff --git a/Gemfile.lock b/Gemfile.lock index 6b5812709..c54bde921 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -149,10 +149,10 @@ GEM delayed_job_active_record (4.1.3) activerecord (>= 3.0, < 5.3) delayed_job (>= 3.0, < 5) - devise (4.3.0) + devise (4.6.2) bcrypt (~> 3.0) orm_adapter (~> 0.1) - railties (>= 4.1.0, < 5.2) + railties (>= 4.1.0, < 6.0) responders warden (~> 1.2.3) devise-async (1.0.0) @@ -547,7 +547,7 @@ DEPENDENCIES dalli (~> 2.7.6) database_cleaner (~> 1.7.0) delayed_job_active_record (~> 4.1.3) - devise (~> 4.3.0) + devise (~> 4.6.0) devise-async (~> 1.0.0) devise_security_extension! email_spec (~> 2.1.0) From 385784d09d1cc8985ed1b21b8064d9a2b3c96c60 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Fri, 17 Aug 2018 09:26:41 -0400 Subject: [PATCH 096/104] Fix failing migrations when running `rake db:migrate` task This patch adds 2 missing colons (:) for 2 migrations that are failing when the `rake db:migrate` task is ran. Whilst already-committed-to-source-control- and-ran-on-production-environments migrations shouldn't be modified whatsoever, this change does not modify in any way the current database schema so, technically, it shouldn't affect forks that might have ran these migrations already and those CONSUL installations that haven't done so should be able to without problems --- .../20170915101519_add_legislation_proposals_count_to_tags.rb | 2 +- .../20170922101247_add_legislation_processes_count_to_tags.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20170915101519_add_legislation_proposals_count_to_tags.rb b/db/migrate/20170915101519_add_legislation_proposals_count_to_tags.rb index 9ce6ace89..8c47394a4 100644 --- a/db/migrate/20170915101519_add_legislation_proposals_count_to_tags.rb +++ b/db/migrate/20170915101519_add_legislation_proposals_count_to_tags.rb @@ -1,6 +1,6 @@ class AddLegislationProposalsCountToTags < ActiveRecord::Migration def change add_column :tags, "legislation/proposals_count", :integer, default: 0 - add_index :tags, "legislation/proposals_count" + add_index :tags, :"legislation/proposals_count" end end diff --git a/db/migrate/20170922101247_add_legislation_processes_count_to_tags.rb b/db/migrate/20170922101247_add_legislation_processes_count_to_tags.rb index 698a66af6..4ae67b760 100644 --- a/db/migrate/20170922101247_add_legislation_processes_count_to_tags.rb +++ b/db/migrate/20170922101247_add_legislation_processes_count_to_tags.rb @@ -1,6 +1,6 @@ class AddLegislationProcessesCountToTags < ActiveRecord::Migration def change add_column :tags, "legislation/processes_count", :integer, default: 0 - add_index :tags, "legislation/processes_count" + add_index :tags, :"legislation/processes_count" end end From 54868356618ede9f09ac9bad7300aa4221e3ea7a Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Mon, 1 Apr 2019 19:29:39 +0200 Subject: [PATCH 097/104] Regenerate DB schema --- db/schema.rb | 587 ++++++++++++++++++++++----------------------------- 1 file changed, 249 insertions(+), 338 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index 61b5e923f..5494af68c 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,4 +1,3 @@ -# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. @@ -24,11 +23,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.text "description" + t.index ["active_poll_id"], name: "index_active_poll_translations_on_active_poll_id", using: :btree + t.index ["locale"], name: "index_active_poll_translations_on_locale", using: :btree end - add_index "active_poll_translations", ["active_poll_id"], name: "index_active_poll_translations_on_active_poll_id", using: :btree - add_index "active_poll_translations", ["locale"], name: "index_active_poll_translations_on_locale", using: :btree - create_table "active_polls", force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -37,15 +35,14 @@ ActiveRecord::Schema.define(version: 20190205131722) do create_table "activities", force: :cascade do |t| t.integer "user_id" t.string "action" - t.integer "actionable_id" t.string "actionable_type" + t.integer "actionable_id" t.datetime "created_at" t.datetime "updated_at" + t.index ["actionable_id", "actionable_type"], name: "index_activities_on_actionable_id_and_actionable_type", using: :btree + t.index ["user_id"], name: "index_activities_on_user_id", using: :btree end - add_index "activities", ["actionable_id", "actionable_type"], name: "index_activities_on_actionable_id_and_actionable_type", using: :btree - add_index "activities", ["user_id"], name: "index_activities_on_user_id", using: :btree - create_table "admin_notification_translations", force: :cascade do |t| t.integer "admin_notification_id", null: false t.string "locale", null: false @@ -53,11 +50,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at", null: false t.string "title" t.text "body" + t.index ["admin_notification_id"], name: "index_admin_notification_translations_on_admin_notification_id", using: :btree + t.index ["locale"], name: "index_admin_notification_translations_on_locale", using: :btree end - add_index "admin_notification_translations", ["admin_notification_id"], name: "index_admin_notification_translations_on_admin_notification_id", using: :btree - add_index "admin_notification_translations", ["locale"], name: "index_admin_notification_translations_on_locale", using: :btree - create_table "admin_notifications", force: :cascade do |t| t.string "title" t.text "body" @@ -71,10 +67,9 @@ ActiveRecord::Schema.define(version: 20190205131722) do create_table "administrators", force: :cascade do |t| t.integer "user_id" + t.index ["user_id"], name: "index_administrators_on_user_id", using: :btree end - add_index "administrators", ["user_id"], name: "index_administrators_on_user_id", using: :btree - create_table "ahoy_events", id: :uuid, default: nil, force: :cascade do |t| t.uuid "visit_id" t.integer "user_id" @@ -82,13 +77,12 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.jsonb "properties" t.datetime "time" t.string "ip" + t.index ["name", "time"], name: "index_ahoy_events_on_name_and_time", using: :btree + t.index ["time"], name: "index_ahoy_events_on_time", using: :btree + t.index ["user_id"], name: "index_ahoy_events_on_user_id", using: :btree + t.index ["visit_id"], name: "index_ahoy_events_on_visit_id", using: :btree end - add_index "ahoy_events", ["name", "time"], name: "index_ahoy_events_on_name_and_time", using: :btree - add_index "ahoy_events", ["time"], name: "index_ahoy_events_on_time", using: :btree - add_index "ahoy_events", ["user_id"], name: "index_ahoy_events_on_user_id", using: :btree - add_index "ahoy_events", ["visit_id"], name: "index_ahoy_events_on_visit_id", using: :btree - create_table "banner_sections", force: :cascade do |t| t.integer "banner_id" t.integer "web_section_id" @@ -103,11 +97,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at", null: false t.string "title" t.text "description" + t.index ["banner_id"], name: "index_banner_translations_on_banner_id", using: :btree + t.index ["locale"], name: "index_banner_translations_on_locale", using: :btree end - add_index "banner_translations", ["banner_id"], name: "index_banner_translations_on_banner_id", using: :btree - add_index "banner_translations", ["locale"], name: "index_banner_translations_on_locale", using: :btree - create_table "banners", force: :cascade do |t| t.string "title", limit: 80 t.string "description" @@ -119,10 +112,9 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at", null: false t.text "background_color" t.text "font_color" + t.index ["hidden_at"], name: "index_banners_on_hidden_at", using: :btree end - add_index "banners", ["hidden_at"], name: "index_banners_on_hidden_at", using: :btree - create_table "budget_ballot_lines", force: :cascade do |t| t.integer "ballot_id" t.integer "investment_id" @@ -131,12 +123,11 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.integer "budget_id" t.integer "group_id" t.integer "heading_id" + t.index ["ballot_id", "investment_id"], name: "index_budget_ballot_lines_on_ballot_id_and_investment_id", unique: true, using: :btree + t.index ["ballot_id"], name: "index_budget_ballot_lines_on_ballot_id", using: :btree + t.index ["investment_id"], name: "index_budget_ballot_lines_on_investment_id", using: :btree end - add_index "budget_ballot_lines", ["ballot_id", "investment_id"], name: "index_budget_ballot_lines_on_ballot_id_and_investment_id", unique: true, using: :btree - add_index "budget_ballot_lines", ["ballot_id"], name: "index_budget_ballot_lines_on_ballot_id", using: :btree - add_index "budget_ballot_lines", ["investment_id"], name: "index_budget_ballot_lines_on_investment_id", using: :btree - create_table "budget_ballots", force: :cascade do |t| t.integer "user_id" t.integer "budget_id" @@ -152,54 +143,49 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "locale" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["heading_id"], name: "index_budget_content_blocks_on_heading_id", using: :btree end - add_index "budget_content_blocks", ["heading_id"], name: "index_budget_content_blocks_on_heading_id", using: :btree - create_table "budget_group_translations", force: :cascade do |t| t.integer "budget_group_id", null: false t.string "locale", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "name" + t.index ["budget_group_id"], name: "index_budget_group_translations_on_budget_group_id", using: :btree + t.index ["locale"], name: "index_budget_group_translations_on_locale", using: :btree end - add_index "budget_group_translations", ["budget_group_id"], name: "index_budget_group_translations_on_budget_group_id", using: :btree - add_index "budget_group_translations", ["locale"], name: "index_budget_group_translations_on_locale", using: :btree - create_table "budget_groups", force: :cascade do |t| t.integer "budget_id" t.string "name", limit: 50 t.string "slug" t.integer "max_votable_headings", default: 1 + t.index ["budget_id"], name: "index_budget_groups_on_budget_id", using: :btree end - add_index "budget_groups", ["budget_id"], name: "index_budget_groups_on_budget_id", using: :btree - create_table "budget_heading_translations", force: :cascade do |t| t.integer "budget_heading_id", null: false t.string "locale", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "name" + t.index ["budget_heading_id"], name: "index_budget_heading_translations_on_budget_heading_id", using: :btree + t.index ["locale"], name: "index_budget_heading_translations_on_locale", using: :btree end - add_index "budget_heading_translations", ["budget_heading_id"], name: "index_budget_heading_translations_on_budget_heading_id", using: :btree - add_index "budget_heading_translations", ["locale"], name: "index_budget_heading_translations_on_locale", using: :btree - create_table "budget_headings", force: :cascade do |t| t.integer "group_id" t.string "name", limit: 50 - t.integer "price", limit: 8 + t.bigint "price" t.integer "population" t.string "slug" t.boolean "allow_custom_content", default: false t.text "latitude" t.text "longitude" + t.index ["group_id"], name: "index_budget_headings_on_group_id", using: :btree end - add_index "budget_headings", ["group_id"], name: "index_budget_headings_on_group_id", using: :btree - create_table "budget_investment_milestone_translations", force: :cascade do |t| t.integer "budget_investment_milestone_id", null: false t.string "locale", null: false @@ -207,11 +193,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at", null: false t.string "title" t.text "description" + t.index ["budget_investment_milestone_id"], name: "index_6770e7675fe296cf87aa0fd90492c141b5269e0b", using: :btree + t.index ["locale"], name: "index_budget_investment_milestone_translations_on_locale", using: :btree end - add_index "budget_investment_milestone_translations", ["budget_investment_milestone_id"], name: "index_6770e7675fe296cf87aa0fd90492c141b5269e0b", using: :btree - add_index "budget_investment_milestone_translations", ["locale"], name: "index_budget_investment_milestone_translations_on_locale", using: :btree - create_table "budget_investment_milestones", force: :cascade do |t| t.integer "investment_id" t.string "title", limit: 80 @@ -220,33 +205,31 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at", null: false t.datetime "publication_date" t.integer "status_id" + t.index ["status_id"], name: "index_budget_investment_milestones_on_status_id", using: :btree end - add_index "budget_investment_milestones", ["status_id"], name: "index_budget_investment_milestones_on_status_id", using: :btree - create_table "budget_investment_statuses", force: :cascade do |t| t.string "name" t.text "description" t.datetime "hidden_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["hidden_at"], name: "index_budget_investment_statuses_on_hidden_at", using: :btree end - add_index "budget_investment_statuses", ["hidden_at"], name: "index_budget_investment_statuses_on_hidden_at", using: :btree - create_table "budget_investments", force: :cascade do |t| t.integer "author_id" t.integer "administrator_id" t.string "title" t.text "description" t.string "external_url" - t.integer "price", limit: 8 + t.bigint "price" t.string "feasibility", limit: 15, default: "undecided" t.text "price_explanation" t.text "unfeasibility_explanation" t.boolean "valuation_finished", default: false t.integer "valuator_assignments_count", default: 0 - t.integer "price_first_year", limit: 8 + t.bigint "price_first_year" t.string "duration" t.datetime "hidden_at" t.integer "cached_votes_up", default: 0 @@ -274,14 +257,13 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "confirmed_hide_at" t.datetime "ignored_flag_at" t.integer "flags_count", default: 0 + t.index ["administrator_id"], name: "index_budget_investments_on_administrator_id", using: :btree + t.index ["author_id"], name: "index_budget_investments_on_author_id", using: :btree + t.index ["community_id"], name: "index_budget_investments_on_community_id", using: :btree + t.index ["heading_id"], name: "index_budget_investments_on_heading_id", using: :btree + t.index ["tsv"], name: "index_budget_investments_on_tsv", using: :gin end - add_index "budget_investments", ["administrator_id"], name: "index_budget_investments_on_administrator_id", using: :btree - add_index "budget_investments", ["author_id"], name: "index_budget_investments_on_author_id", using: :btree - add_index "budget_investments", ["community_id"], name: "index_budget_investments_on_community_id", using: :btree - add_index "budget_investments", ["heading_id"], name: "index_budget_investments_on_heading_id", using: :btree - add_index "budget_investments", ["tsv"], name: "index_budget_investments_on_tsv", using: :gin - create_table "budget_phase_translations", force: :cascade do |t| t.integer "budget_phase_id", null: false t.string "locale", null: false @@ -289,11 +271,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at", null: false t.text "description" t.text "summary" + t.index ["budget_phase_id"], name: "index_budget_phase_translations_on_budget_phase_id", using: :btree + t.index ["locale"], name: "index_budget_phase_translations_on_locale", using: :btree end - add_index "budget_phase_translations", ["budget_phase_id"], name: "index_budget_phase_translations_on_budget_phase_id", using: :btree - add_index "budget_phase_translations", ["locale"], name: "index_budget_phase_translations_on_locale", using: :btree - create_table "budget_phases", force: :cascade do |t| t.integer "budget_id" t.integer "next_phase_id" @@ -303,13 +284,12 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "starts_at" t.datetime "ends_at" t.boolean "enabled", default: true + t.index ["ends_at"], name: "index_budget_phases_on_ends_at", using: :btree + t.index ["kind"], name: "index_budget_phases_on_kind", using: :btree + t.index ["next_phase_id"], name: "index_budget_phases_on_next_phase_id", using: :btree + t.index ["starts_at"], name: "index_budget_phases_on_starts_at", using: :btree end - add_index "budget_phases", ["ends_at"], name: "index_budget_phases_on_ends_at", using: :btree - add_index "budget_phases", ["kind"], name: "index_budget_phases_on_kind", using: :btree - add_index "budget_phases", ["next_phase_id"], name: "index_budget_phases_on_next_phase_id", using: :btree - add_index "budget_phases", ["starts_at"], name: "index_budget_phases_on_starts_at", using: :btree - create_table "budget_reclassified_votes", force: :cascade do |t| t.integer "user_id" t.integer "investment_id" @@ -324,20 +304,18 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "name" + t.index ["budget_id"], name: "index_budget_translations_on_budget_id", using: :btree + t.index ["locale"], name: "index_budget_translations_on_locale", using: :btree end - add_index "budget_translations", ["budget_id"], name: "index_budget_translations_on_budget_id", using: :btree - add_index "budget_translations", ["locale"], name: "index_budget_translations_on_locale", using: :btree - create_table "budget_valuator_assignments", force: :cascade do |t| t.integer "valuator_id" t.integer "investment_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["investment_id"], name: "index_budget_valuator_assignments_on_investment_id", using: :btree end - add_index "budget_valuator_assignments", ["investment_id"], name: "index_budget_valuator_assignments_on_investment_id", using: :btree - create_table "budget_valuator_group_assignments", force: :cascade do |t| t.integer "valuator_group_id" t.integer "investment_id" @@ -379,10 +357,9 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.integer "height" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["type"], name: "index_ckeditor_assets_on_type", using: :btree end - add_index "ckeditor_assets", ["type"], name: "index_ckeditor_assets_on_type", using: :btree - create_table "comments", force: :cascade do |t| t.integer "commentable_id" t.string "commentable_type" @@ -403,17 +380,16 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "ancestry" t.integer "confidence_score", default: 0, null: false t.boolean "valuation", default: false + t.index ["ancestry"], name: "index_comments_on_ancestry", using: :btree + t.index ["cached_votes_down"], name: "index_comments_on_cached_votes_down", using: :btree + t.index ["cached_votes_total"], name: "index_comments_on_cached_votes_total", using: :btree + t.index ["cached_votes_up"], name: "index_comments_on_cached_votes_up", using: :btree + t.index ["commentable_id", "commentable_type"], name: "index_comments_on_commentable_id_and_commentable_type", using: :btree + t.index ["hidden_at"], name: "index_comments_on_hidden_at", using: :btree + t.index ["user_id"], name: "index_comments_on_user_id", using: :btree + t.index ["valuation"], name: "index_comments_on_valuation", using: :btree end - add_index "comments", ["ancestry"], name: "index_comments_on_ancestry", using: :btree - add_index "comments", ["cached_votes_down"], name: "index_comments_on_cached_votes_down", using: :btree - add_index "comments", ["cached_votes_total"], name: "index_comments_on_cached_votes_total", using: :btree - add_index "comments", ["cached_votes_up"], name: "index_comments_on_cached_votes_up", using: :btree - add_index "comments", ["commentable_id", "commentable_type"], name: "index_comments_on_commentable_id_and_commentable_type", using: :btree - add_index "comments", ["hidden_at"], name: "index_comments_on_hidden_at", using: :btree - add_index "comments", ["user_id"], name: "index_comments_on_user_id", using: :btree - add_index "comments", ["valuation"], name: "index_comments_on_valuation", using: :btree - create_table "communities", force: :cascade do |t| t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -436,26 +412,25 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "confirmed_hide_at" t.integer "cached_anonymous_votes_total", default: 0 t.integer "cached_votes_score", default: 0 - t.integer "hot_score", limit: 8, default: 0 + t.bigint "hot_score", default: 0 t.integer "confidence_score", default: 0 t.integer "geozone_id" t.tsvector "tsv" t.datetime "featured_at" + t.index ["author_id", "hidden_at"], name: "index_debates_on_author_id_and_hidden_at", using: :btree + t.index ["author_id"], name: "index_debates_on_author_id", using: :btree + t.index ["cached_votes_down"], name: "index_debates_on_cached_votes_down", using: :btree + t.index ["cached_votes_score"], name: "index_debates_on_cached_votes_score", using: :btree + t.index ["cached_votes_total"], name: "index_debates_on_cached_votes_total", using: :btree + t.index ["cached_votes_up"], name: "index_debates_on_cached_votes_up", using: :btree + t.index ["confidence_score"], name: "index_debates_on_confidence_score", using: :btree + t.index ["geozone_id"], name: "index_debates_on_geozone_id", using: :btree + t.index ["hidden_at"], name: "index_debates_on_hidden_at", using: :btree + t.index ["hot_score"], name: "index_debates_on_hot_score", using: :btree + t.index ["title"], name: "index_debates_on_title", using: :btree + t.index ["tsv"], name: "index_debates_on_tsv", using: :gin end - add_index "debates", ["author_id", "hidden_at"], name: "index_debates_on_author_id_and_hidden_at", using: :btree - add_index "debates", ["author_id"], name: "index_debates_on_author_id", using: :btree - add_index "debates", ["cached_votes_down"], name: "index_debates_on_cached_votes_down", using: :btree - add_index "debates", ["cached_votes_score"], name: "index_debates_on_cached_votes_score", using: :btree - add_index "debates", ["cached_votes_total"], name: "index_debates_on_cached_votes_total", using: :btree - add_index "debates", ["cached_votes_up"], name: "index_debates_on_cached_votes_up", using: :btree - add_index "debates", ["confidence_score"], name: "index_debates_on_confidence_score", using: :btree - add_index "debates", ["geozone_id"], name: "index_debates_on_geozone_id", using: :btree - add_index "debates", ["hidden_at"], name: "index_debates_on_hidden_at", using: :btree - add_index "debates", ["hot_score"], name: "index_debates_on_hot_score", using: :btree - add_index "debates", ["title"], name: "index_debates_on_title", using: :btree - add_index "debates", ["tsv"], name: "index_debates_on_tsv", using: :gin - create_table "delayed_jobs", force: :cascade do |t| t.integer "priority", default: 0, null: false t.integer "attempts", default: 0, null: false @@ -468,10 +443,9 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "queue" t.datetime "created_at" t.datetime "updated_at" + t.index ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree end - add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority", using: :btree - create_table "direct_messages", force: :cascade do |t| t.integer "sender_id" t.integer "receiver_id" @@ -488,16 +462,15 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.integer "attachment_file_size" t.datetime "attachment_updated_at" t.integer "user_id" - t.integer "documentable_id" t.string "documentable_type" + t.integer "documentable_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["documentable_type", "documentable_id"], name: "index_documents_on_documentable_type_and_documentable_id", using: :btree + t.index ["user_id", "documentable_type", "documentable_id"], name: "access_documents", using: :btree + t.index ["user_id"], name: "index_documents_on_user_id", using: :btree end - add_index "documents", ["documentable_type", "documentable_id"], name: "index_documents_on_documentable_type_and_documentable_id", using: :btree - add_index "documents", ["user_id", "documentable_type", "documentable_id"], name: "access_documents", using: :btree - add_index "documents", ["user_id"], name: "index_documents_on_user_id", using: :btree - create_table "failed_census_calls", force: :cascade do |t| t.integer "user_id" t.string "document_number" @@ -509,34 +482,31 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "district_code" t.integer "poll_officer_id" t.integer "year_of_birth" + t.index ["user_id"], name: "index_failed_census_calls_on_user_id", using: :btree end - add_index "failed_census_calls", ["user_id"], name: "index_failed_census_calls_on_user_id", using: :btree - create_table "flags", force: :cascade do |t| t.integer "user_id" t.string "flaggable_type" t.integer "flaggable_id" t.datetime "created_at" t.datetime "updated_at" + t.index ["flaggable_type", "flaggable_id"], name: "index_flags_on_flaggable_type_and_flaggable_id", using: :btree + t.index ["user_id", "flaggable_type", "flaggable_id"], name: "access_inappropiate_flags", using: :btree + t.index ["user_id"], name: "index_flags_on_user_id", using: :btree end - add_index "flags", ["flaggable_type", "flaggable_id"], name: "index_flags_on_flaggable_type_and_flaggable_id", using: :btree - add_index "flags", ["user_id", "flaggable_type", "flaggable_id"], name: "access_inappropiate_flags", using: :btree - add_index "flags", ["user_id"], name: "index_flags_on_user_id", using: :btree - create_table "follows", force: :cascade do |t| t.integer "user_id" - t.integer "followable_id" t.string "followable_type" + t.integer "followable_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["followable_type", "followable_id"], name: "index_follows_on_followable_type_and_followable_id", using: :btree + t.index ["user_id", "followable_type", "followable_id"], name: "access_follows", using: :btree + t.index ["user_id"], name: "index_follows_on_user_id", using: :btree end - add_index "follows", ["followable_type", "followable_id"], name: "index_follows_on_followable_type_and_followable_id", using: :btree - add_index "follows", ["user_id", "followable_type", "followable_id"], name: "access_follows", using: :btree - add_index "follows", ["user_id"], name: "index_follows_on_user_id", using: :btree - create_table "geozones", force: :cascade do |t| t.string "name" t.string "html_map_coordinates" @@ -549,22 +519,20 @@ ActiveRecord::Schema.define(version: 20190205131722) do create_table "geozones_polls", force: :cascade do |t| t.integer "geozone_id" t.integer "poll_id" + t.index ["geozone_id"], name: "index_geozones_polls_on_geozone_id", using: :btree + t.index ["poll_id"], name: "index_geozones_polls_on_poll_id", using: :btree end - add_index "geozones_polls", ["geozone_id"], name: "index_geozones_polls_on_geozone_id", using: :btree - add_index "geozones_polls", ["poll_id"], name: "index_geozones_polls_on_poll_id", using: :btree - create_table "i18n_content_translations", force: :cascade do |t| t.integer "i18n_content_id", null: false t.string "locale", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.text "value" + t.index ["i18n_content_id"], name: "index_i18n_content_translations_on_i18n_content_id", using: :btree + t.index ["locale"], name: "index_i18n_content_translations_on_locale", using: :btree end - add_index "i18n_content_translations", ["i18n_content_id"], name: "index_i18n_content_translations_on_i18n_content_id", using: :btree - add_index "i18n_content_translations", ["locale"], name: "index_i18n_content_translations_on_locale", using: :btree - create_table "i18n_contents", force: :cascade do |t| t.string "key" end @@ -575,13 +543,12 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "uid" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["user_id"], name: "index_identities_on_user_id", using: :btree end - add_index "identities", ["user_id"], name: "index_identities_on_user_id", using: :btree - create_table "images", force: :cascade do |t| - t.integer "imageable_id" t.string "imageable_type" + t.integer "imageable_id" t.string "title", limit: 80 t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -590,11 +557,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.integer "attachment_file_size" t.datetime "attachment_updated_at" t.integer "user_id" + t.index ["imageable_type", "imageable_id"], name: "index_images_on_imageable_type_and_imageable_id", using: :btree + t.index ["user_id"], name: "index_images_on_user_id", using: :btree end - add_index "images", ["imageable_type", "imageable_id"], name: "index_images_on_imageable_type_and_imageable_id", using: :btree - add_index "images", ["user_id"], name: "index_images_on_user_id", using: :btree - create_table "legislation_annotations", force: :cascade do |t| t.string "quote" t.text "ranges" @@ -610,13 +576,12 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "range_end" t.integer "range_end_offset" t.text "context" + t.index ["author_id"], name: "index_legislation_annotations_on_author_id", using: :btree + t.index ["hidden_at"], name: "index_legislation_annotations_on_hidden_at", using: :btree + t.index ["legislation_draft_version_id"], name: "index_legislation_annotations_on_legislation_draft_version_id", using: :btree + t.index ["range_start", "range_end"], name: "index_legislation_annotations_on_range_start_and_range_end", using: :btree end - add_index "legislation_annotations", ["author_id"], name: "index_legislation_annotations_on_author_id", using: :btree - add_index "legislation_annotations", ["hidden_at"], name: "index_legislation_annotations_on_hidden_at", using: :btree - add_index "legislation_annotations", ["legislation_draft_version_id"], name: "index_legislation_annotations_on_legislation_draft_version_id", using: :btree - add_index "legislation_annotations", ["range_start", "range_end"], name: "index_legislation_annotations_on_range_start_and_range_end", using: :btree - create_table "legislation_answers", force: :cascade do |t| t.integer "legislation_question_id" t.integer "legislation_question_option_id" @@ -624,13 +589,12 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "hidden_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["hidden_at"], name: "index_legislation_answers_on_hidden_at", using: :btree + t.index ["legislation_question_id"], name: "index_legislation_answers_on_legislation_question_id", using: :btree + t.index ["legislation_question_option_id"], name: "index_legislation_answers_on_legislation_question_option_id", using: :btree + t.index ["user_id"], name: "index_legislation_answers_on_user_id", using: :btree end - add_index "legislation_answers", ["hidden_at"], name: "index_legislation_answers_on_hidden_at", using: :btree - add_index "legislation_answers", ["legislation_question_id"], name: "index_legislation_answers_on_legislation_question_id", using: :btree - add_index "legislation_answers", ["legislation_question_option_id"], name: "index_legislation_answers_on_legislation_question_option_id", using: :btree - add_index "legislation_answers", ["user_id"], name: "index_legislation_answers_on_user_id", using: :btree - create_table "legislation_draft_version_translations", force: :cascade do |t| t.integer "legislation_draft_version_id", null: false t.string "locale", null: false @@ -641,11 +605,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.text "body" t.text "body_html" t.text "toc_html" + t.index ["legislation_draft_version_id"], name: "index_900e5ba94457606e69e89193db426e8ddff809bc", using: :btree + t.index ["locale"], name: "index_legislation_draft_version_translations_on_locale", using: :btree end - add_index "legislation_draft_version_translations", ["legislation_draft_version_id"], name: "index_900e5ba94457606e69e89193db426e8ddff809bc", using: :btree - add_index "legislation_draft_version_translations", ["locale"], name: "index_legislation_draft_version_translations_on_locale", using: :btree - create_table "legislation_draft_versions", force: :cascade do |t| t.integer "legislation_process_id" t.string "title" @@ -658,12 +621,11 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at", null: false t.text "body_html" t.text "toc_html" + t.index ["hidden_at"], name: "index_legislation_draft_versions_on_hidden_at", using: :btree + t.index ["legislation_process_id"], name: "index_legislation_draft_versions_on_legislation_process_id", using: :btree + t.index ["status"], name: "index_legislation_draft_versions_on_status", using: :btree end - add_index "legislation_draft_versions", ["hidden_at"], name: "index_legislation_draft_versions_on_hidden_at", using: :btree - add_index "legislation_draft_versions", ["legislation_process_id"], name: "index_legislation_draft_versions_on_legislation_process_id", using: :btree - add_index "legislation_draft_versions", ["status"], name: "index_legislation_draft_versions_on_status", using: :btree - create_table "legislation_process_translations", force: :cascade do |t| t.integer "legislation_process_id", null: false t.string "locale", null: false @@ -675,11 +637,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.text "additional_info" t.text "milestones_summary" t.text "homepage" + t.index ["legislation_process_id"], name: "index_199e5fed0aca73302243f6a1fca885ce10cdbb55", using: :btree + t.index ["locale"], name: "index_legislation_process_translations_on_locale", using: :btree end - add_index "legislation_process_translations", ["legislation_process_id"], name: "index_199e5fed0aca73302243f6a1fca885ce10cdbb55", using: :btree - add_index "legislation_process_translations", ["locale"], name: "index_legislation_process_translations_on_locale", using: :btree - create_table "legislation_processes", force: :cascade do |t| t.string "title" t.text "description" @@ -711,20 +672,19 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.boolean "homepage_enabled", default: false t.text "background_color" t.text "font_color" + t.index ["allegations_end_date"], name: "index_legislation_processes_on_allegations_end_date", using: :btree + t.index ["allegations_start_date"], name: "index_legislation_processes_on_allegations_start_date", using: :btree + t.index ["debate_end_date"], name: "index_legislation_processes_on_debate_end_date", using: :btree + t.index ["debate_start_date"], name: "index_legislation_processes_on_debate_start_date", using: :btree + t.index ["draft_end_date"], name: "index_legislation_processes_on_draft_end_date", using: :btree + t.index ["draft_publication_date"], name: "index_legislation_processes_on_draft_publication_date", using: :btree + t.index ["draft_start_date"], name: "index_legislation_processes_on_draft_start_date", using: :btree + t.index ["end_date"], name: "index_legislation_processes_on_end_date", using: :btree + t.index ["hidden_at"], name: "index_legislation_processes_on_hidden_at", using: :btree + t.index ["result_publication_date"], name: "index_legislation_processes_on_result_publication_date", using: :btree + t.index ["start_date"], name: "index_legislation_processes_on_start_date", using: :btree end - add_index "legislation_processes", ["allegations_end_date"], name: "index_legislation_processes_on_allegations_end_date", using: :btree - add_index "legislation_processes", ["allegations_start_date"], name: "index_legislation_processes_on_allegations_start_date", using: :btree - add_index "legislation_processes", ["debate_end_date"], name: "index_legislation_processes_on_debate_end_date", using: :btree - add_index "legislation_processes", ["debate_start_date"], name: "index_legislation_processes_on_debate_start_date", using: :btree - add_index "legislation_processes", ["draft_end_date"], name: "index_legislation_processes_on_draft_end_date", using: :btree - add_index "legislation_processes", ["draft_publication_date"], name: "index_legislation_processes_on_draft_publication_date", using: :btree - add_index "legislation_processes", ["draft_start_date"], name: "index_legislation_processes_on_draft_start_date", using: :btree - add_index "legislation_processes", ["end_date"], name: "index_legislation_processes_on_end_date", using: :btree - add_index "legislation_processes", ["hidden_at"], name: "index_legislation_processes_on_hidden_at", using: :btree - add_index "legislation_processes", ["result_publication_date"], name: "index_legislation_processes_on_result_publication_date", using: :btree - add_index "legislation_processes", ["start_date"], name: "index_legislation_processes_on_start_date", using: :btree - create_table "legislation_proposals", force: :cascade do |t| t.integer "legislation_process_id" t.string "title", limit: 80 @@ -738,7 +698,7 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.integer "cached_votes_up", default: 0 t.integer "comments_count", default: 0 t.datetime "confirmed_hide_at" - t.integer "hot_score", limit: 8, default: 0 + t.bigint "hot_score", default: 0 t.integer "confidence_score", default: 0 t.string "responsible_name", limit: 60 t.text "summary" @@ -755,22 +715,20 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.integer "cached_votes_down", default: 0 t.boolean "selected" t.integer "cached_votes_score", default: 0 + t.index ["cached_votes_score"], name: "index_legislation_proposals_on_cached_votes_score", using: :btree + t.index ["legislation_process_id"], name: "index_legislation_proposals_on_legislation_process_id", using: :btree end - add_index "legislation_proposals", ["cached_votes_score"], name: "index_legislation_proposals_on_cached_votes_score", using: :btree - add_index "legislation_proposals", ["legislation_process_id"], name: "index_legislation_proposals_on_legislation_process_id", using: :btree - create_table "legislation_question_option_translations", force: :cascade do |t| t.integer "legislation_question_option_id", null: false t.string "locale", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "value" + t.index ["legislation_question_option_id"], name: "index_61bcec8729110b7f8e1e9e5ce08780878597a209", using: :btree + t.index ["locale"], name: "index_legislation_question_option_translations_on_locale", using: :btree end - add_index "legislation_question_option_translations", ["legislation_question_option_id"], name: "index_61bcec8729110b7f8e1e9e5ce08780878597a209", using: :btree - add_index "legislation_question_option_translations", ["locale"], name: "index_legislation_question_option_translations_on_locale", using: :btree - create_table "legislation_question_options", force: :cascade do |t| t.integer "legislation_question_id" t.string "value" @@ -778,22 +736,20 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "hidden_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["hidden_at"], name: "index_legislation_question_options_on_hidden_at", using: :btree + t.index ["legislation_question_id"], name: "index_legislation_question_options_on_legislation_question_id", using: :btree end - add_index "legislation_question_options", ["hidden_at"], name: "index_legislation_question_options_on_hidden_at", using: :btree - add_index "legislation_question_options", ["legislation_question_id"], name: "index_legislation_question_options_on_legislation_question_id", using: :btree - create_table "legislation_question_translations", force: :cascade do |t| t.integer "legislation_question_id", null: false t.string "locale", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.text "title" + t.index ["legislation_question_id"], name: "index_d34cc1e1fe6d5162210c41ce56533c5afabcdbd3", using: :btree + t.index ["locale"], name: "index_legislation_question_translations_on_locale", using: :btree end - add_index "legislation_question_translations", ["legislation_question_id"], name: "index_d34cc1e1fe6d5162210c41ce56533c5afabcdbd3", using: :btree - add_index "legislation_question_translations", ["locale"], name: "index_legislation_question_translations_on_locale", using: :btree - create_table "legislation_questions", force: :cascade do |t| t.integer "legislation_process_id" t.text "title" @@ -803,11 +759,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at", null: false t.integer "comments_count", default: 0 t.integer "author_id" + t.index ["hidden_at"], name: "index_legislation_questions_on_hidden_at", using: :btree + t.index ["legislation_process_id"], name: "index_legislation_questions_on_legislation_process_id", using: :btree end - add_index "legislation_questions", ["hidden_at"], name: "index_legislation_questions_on_hidden_at", using: :btree - add_index "legislation_questions", ["legislation_process_id"], name: "index_legislation_questions_on_legislation_process_id", using: :btree - create_table "local_census_records", force: :cascade do |t| t.string "document_number", null: false t.string "document_type", null: false @@ -823,37 +778,33 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "locked_until", default: '2000-01-01 01:01:01', null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["user_id"], name: "index_locks_on_user_id", using: :btree end - add_index "locks", ["user_id"], name: "index_locks_on_user_id", using: :btree - create_table "managers", force: :cascade do |t| t.integer "user_id" + t.index ["user_id"], name: "index_managers_on_user_id", using: :btree end - add_index "managers", ["user_id"], name: "index_managers_on_user_id", using: :btree - create_table "map_locations", force: :cascade do |t| t.float "latitude" t.float "longitude" t.integer "zoom" t.integer "proposal_id" t.integer "investment_id" + t.index ["investment_id"], name: "index_map_locations_on_investment_id", using: :btree + t.index ["proposal_id"], name: "index_map_locations_on_proposal_id", using: :btree end - add_index "map_locations", ["investment_id"], name: "index_map_locations_on_investment_id", using: :btree - add_index "map_locations", ["proposal_id"], name: "index_map_locations_on_proposal_id", using: :btree - create_table "milestone_statuses", force: :cascade do |t| t.string "name" t.text "description" t.datetime "hidden_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["hidden_at"], name: "index_milestone_statuses_on_hidden_at", using: :btree end - add_index "milestone_statuses", ["hidden_at"], name: "index_milestone_statuses_on_hidden_at", using: :btree - create_table "milestone_translations", force: :cascade do |t| t.integer "milestone_id", null: false t.string "locale", null: false @@ -861,30 +812,27 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at", null: false t.string "title" t.text "description" + t.index ["locale"], name: "index_milestone_translations_on_locale", using: :btree + t.index ["milestone_id"], name: "index_milestone_translations_on_milestone_id", using: :btree end - add_index "milestone_translations", ["locale"], name: "index_milestone_translations_on_locale", using: :btree - add_index "milestone_translations", ["milestone_id"], name: "index_milestone_translations_on_milestone_id", using: :btree - create_table "milestones", force: :cascade do |t| - t.integer "milestoneable_id" t.string "milestoneable_type" + t.integer "milestoneable_id" t.string "title", limit: 80 t.text "description" t.datetime "publication_date" t.integer "status_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["status_id"], name: "index_milestones_on_status_id", using: :btree end - add_index "milestones", ["status_id"], name: "index_milestones_on_status_id", using: :btree - create_table "moderators", force: :cascade do |t| t.integer "user_id" + t.index ["user_id"], name: "index_moderators_on_user_id", using: :btree end - add_index "moderators", ["user_id"], name: "index_moderators_on_user_id", using: :btree - create_table "newsletters", force: :cascade do |t| t.string "subject" t.string "segment_recipient", null: false @@ -898,48 +846,44 @@ ActiveRecord::Schema.define(version: 20190205131722) do create_table "notifications", force: :cascade do |t| t.integer "user_id" - t.integer "notifiable_id" t.string "notifiable_type" + t.integer "notifiable_id" t.integer "counter", default: 1 t.datetime "emailed_at" t.datetime "read_at" + t.index ["user_id"], name: "index_notifications_on_user_id", using: :btree end - add_index "notifications", ["user_id"], name: "index_notifications_on_user_id", using: :btree - create_table "organizations", force: :cascade do |t| t.integer "user_id" t.string "name", limit: 60 t.datetime "verified_at" t.datetime "rejected_at" t.string "responsible_name", limit: 60 + t.index ["user_id"], name: "index_organizations_on_user_id", using: :btree end - add_index "organizations", ["user_id"], name: "index_organizations_on_user_id", using: :btree - create_table "poll_answers", force: :cascade do |t| t.integer "question_id" t.integer "author_id" t.string "answer" t.datetime "created_at" t.datetime "updated_at" + t.index ["author_id"], name: "index_poll_answers_on_author_id", using: :btree + t.index ["question_id", "answer"], name: "index_poll_answers_on_question_id_and_answer", using: :btree + t.index ["question_id"], name: "index_poll_answers_on_question_id", using: :btree end - add_index "poll_answers", ["author_id"], name: "index_poll_answers_on_author_id", using: :btree - add_index "poll_answers", ["question_id", "answer"], name: "index_poll_answers_on_question_id_and_answer", using: :btree - add_index "poll_answers", ["question_id"], name: "index_poll_answers_on_question_id", using: :btree - create_table "poll_ballot_sheets", force: :cascade do |t| t.text "data" t.integer "poll_id" t.integer "officer_assignment_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["officer_assignment_id"], name: "index_poll_ballot_sheets_on_officer_assignment_id", using: :btree + t.index ["poll_id"], name: "index_poll_ballot_sheets_on_poll_id", using: :btree end - add_index "poll_ballot_sheets", ["officer_assignment_id"], name: "index_poll_ballot_sheets_on_officer_assignment_id", using: :btree - add_index "poll_ballot_sheets", ["poll_id"], name: "index_poll_ballot_sheets_on_poll_id", using: :btree - create_table "poll_ballots", force: :cascade do |t| t.integer "ballot_sheet_id" t.text "data" @@ -953,11 +897,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.integer "poll_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["booth_id"], name: "index_poll_booth_assignments_on_booth_id", using: :btree + t.index ["poll_id"], name: "index_poll_booth_assignments_on_poll_id", using: :btree end - add_index "poll_booth_assignments", ["booth_id"], name: "index_poll_booth_assignments_on_booth_id", using: :btree - add_index "poll_booth_assignments", ["poll_id"], name: "index_poll_booth_assignments_on_poll_id", using: :btree - create_table "poll_booths", force: :cascade do |t| t.string "name" t.string "location" @@ -971,18 +914,16 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.date "date", null: false t.boolean "final", default: false t.string "user_data_log", default: "" + t.index ["booth_assignment_id"], name: "index_poll_officer_assignments_on_booth_assignment_id", using: :btree + t.index ["officer_id"], name: "index_poll_officer_assignments_on_officer_id", using: :btree end - add_index "poll_officer_assignments", ["booth_assignment_id"], name: "index_poll_officer_assignments_on_booth_assignment_id", using: :btree - add_index "poll_officer_assignments", ["officer_id"], name: "index_poll_officer_assignments_on_officer_id", using: :btree - create_table "poll_officers", force: :cascade do |t| t.integer "user_id" t.integer "failed_census_calls_count", default: 0 + t.index ["user_id"], name: "index_poll_officers_on_user_id", using: :btree end - add_index "poll_officers", ["user_id"], name: "index_poll_officers_on_user_id", using: :btree - create_table "poll_partial_results", force: :cascade do |t| t.integer "question_id" t.integer "author_id" @@ -995,14 +936,13 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.text "amount_log", default: "" t.text "officer_assignment_id_log", default: "" t.text "author_id_log", default: "" + t.index ["answer"], name: "index_poll_partial_results_on_answer", using: :btree + t.index ["author_id"], name: "index_poll_partial_results_on_author_id", using: :btree + t.index ["booth_assignment_id", "date"], name: "index_poll_partial_results_on_booth_assignment_id_and_date", using: :btree + t.index ["origin"], name: "index_poll_partial_results_on_origin", using: :btree + t.index ["question_id"], name: "index_poll_partial_results_on_question_id", using: :btree end - add_index "poll_partial_results", ["answer"], name: "index_poll_partial_results_on_answer", using: :btree - add_index "poll_partial_results", ["author_id"], name: "index_poll_partial_results_on_author_id", using: :btree - add_index "poll_partial_results", ["booth_assignment_id", "date"], name: "index_poll_partial_results_on_booth_assignment_id_and_date", using: :btree - add_index "poll_partial_results", ["origin"], name: "index_poll_partial_results_on_origin", using: :btree - add_index "poll_partial_results", ["question_id"], name: "index_poll_partial_results_on_question_id", using: :btree - create_table "poll_question_answer_translations", force: :cascade do |t| t.integer "poll_question_answer_id", null: false t.string "locale", null: false @@ -1010,40 +950,36 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at", null: false t.string "title" t.text "description" + t.index ["locale"], name: "index_poll_question_answer_translations_on_locale", using: :btree + t.index ["poll_question_answer_id"], name: "index_85270fa85f62081a3a227186b4c95fe4f7fa94b9", using: :btree end - add_index "poll_question_answer_translations", ["locale"], name: "index_poll_question_answer_translations_on_locale", using: :btree - add_index "poll_question_answer_translations", ["poll_question_answer_id"], name: "index_85270fa85f62081a3a227186b4c95fe4f7fa94b9", using: :btree - create_table "poll_question_answer_videos", force: :cascade do |t| t.string "title" t.string "url" t.integer "answer_id" + t.index ["answer_id"], name: "index_poll_question_answer_videos_on_answer_id", using: :btree end - add_index "poll_question_answer_videos", ["answer_id"], name: "index_poll_question_answer_videos_on_answer_id", using: :btree - create_table "poll_question_answers", force: :cascade do |t| t.string "title" t.text "description" t.integer "question_id" t.integer "given_order", default: 1 t.boolean "most_voted", default: false + t.index ["question_id"], name: "index_poll_question_answers_on_question_id", using: :btree end - add_index "poll_question_answers", ["question_id"], name: "index_poll_question_answers_on_question_id", using: :btree - create_table "poll_question_translations", force: :cascade do |t| t.integer "poll_question_id", null: false t.string "locale", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "title" + t.index ["locale"], name: "index_poll_question_translations_on_locale", using: :btree + t.index ["poll_question_id"], name: "index_poll_question_translations_on_poll_question_id", using: :btree end - add_index "poll_question_translations", ["locale"], name: "index_poll_question_translations_on_locale", using: :btree - add_index "poll_question_translations", ["poll_question_id"], name: "index_poll_question_translations_on_poll_question_id", using: :btree - create_table "poll_questions", force: :cascade do |t| t.integer "proposal_id" t.integer "poll_id" @@ -1056,13 +992,12 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at" t.tsvector "tsv" t.string "video_url" + t.index ["author_id"], name: "index_poll_questions_on_author_id", using: :btree + t.index ["poll_id"], name: "index_poll_questions_on_poll_id", using: :btree + t.index ["proposal_id"], name: "index_poll_questions_on_proposal_id", using: :btree + t.index ["tsv"], name: "index_poll_questions_on_tsv", using: :gin end - add_index "poll_questions", ["author_id"], name: "index_poll_questions_on_author_id", using: :btree - add_index "poll_questions", ["poll_id"], name: "index_poll_questions_on_poll_id", using: :btree - add_index "poll_questions", ["proposal_id"], name: "index_poll_questions_on_proposal_id", using: :btree - add_index "poll_questions", ["tsv"], name: "index_poll_questions_on_tsv", using: :gin - create_table "poll_recounts", force: :cascade do |t| t.integer "author_id" t.string "origin" @@ -1077,11 +1012,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.text "null_amount_log", default: "" t.integer "total_amount", default: 0 t.text "total_amount_log", default: "" + t.index ["booth_assignment_id"], name: "index_poll_recounts_on_booth_assignment_id", using: :btree + t.index ["officer_assignment_id"], name: "index_poll_recounts_on_officer_assignment_id", using: :btree end - add_index "poll_recounts", ["booth_assignment_id"], name: "index_poll_recounts_on_booth_assignment_id", using: :btree - add_index "poll_recounts", ["officer_assignment_id"], name: "index_poll_recounts_on_officer_assignment_id", using: :btree - create_table "poll_shifts", force: :cascade do |t| t.integer "booth_id" t.integer "officer_id" @@ -1091,12 +1025,11 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "officer_name" t.string "officer_email" t.integer "task", default: 0, null: false + t.index ["booth_id", "officer_id", "date", "task"], name: "index_poll_shifts_on_booth_id_and_officer_id_and_date_and_task", unique: true, using: :btree + t.index ["booth_id"], name: "index_poll_shifts_on_booth_id", using: :btree + t.index ["officer_id"], name: "index_poll_shifts_on_officer_id", using: :btree end - add_index "poll_shifts", ["booth_id", "officer_id", "date", "task"], name: "index_poll_shifts_on_booth_id_and_officer_id_and_date_and_task", unique: true, using: :btree - add_index "poll_shifts", ["booth_id"], name: "index_poll_shifts_on_booth_id", using: :btree - add_index "poll_shifts", ["officer_id"], name: "index_poll_shifts_on_officer_id", using: :btree - create_table "poll_translations", force: :cascade do |t| t.integer "poll_id", null: false t.string "locale", null: false @@ -1105,11 +1038,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "name" t.text "summary" t.text "description" + t.index ["locale"], name: "index_poll_translations_on_locale", using: :btree + t.index ["poll_id"], name: "index_poll_translations_on_poll_id", using: :btree end - add_index "poll_translations", ["locale"], name: "index_poll_translations_on_locale", using: :btree - add_index "poll_translations", ["poll_id"], name: "index_poll_translations_on_poll_id", using: :btree - create_table "poll_voters", force: :cascade do |t| t.string "document_number" t.string "document_type" @@ -1126,15 +1058,14 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "origin" t.integer "officer_id" t.string "token" + t.index ["booth_assignment_id"], name: "index_poll_voters_on_booth_assignment_id", using: :btree + t.index ["document_number"], name: "index_poll_voters_on_document_number", using: :btree + t.index ["officer_assignment_id"], name: "index_poll_voters_on_officer_assignment_id", using: :btree + t.index ["poll_id", "document_number", "document_type"], name: "doc_by_poll", using: :btree + t.index ["poll_id"], name: "index_poll_voters_on_poll_id", using: :btree + t.index ["user_id"], name: "index_poll_voters_on_user_id", using: :btree end - add_index "poll_voters", ["booth_assignment_id"], name: "index_poll_voters_on_booth_assignment_id", using: :btree - add_index "poll_voters", ["document_number"], name: "index_poll_voters_on_document_number", using: :btree - add_index "poll_voters", ["officer_assignment_id"], name: "index_poll_voters_on_officer_assignment_id", using: :btree - add_index "poll_voters", ["poll_id", "document_number", "document_type"], name: "doc_by_poll", using: :btree - add_index "poll_voters", ["poll_id"], name: "index_poll_voters_on_poll_id", using: :btree - add_index "poll_voters", ["user_id"], name: "index_poll_voters_on_user_id", using: :btree - create_table "polls", force: :cascade do |t| t.string "name" t.datetime "starts_at" @@ -1151,27 +1082,25 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "created_at" t.datetime "updated_at" t.integer "budget_id" + t.index ["budget_id"], name: "index_polls_on_budget_id", unique: true, using: :btree + t.index ["starts_at", "ends_at"], name: "index_polls_on_starts_at_and_ends_at", using: :btree end - add_index "polls", ["budget_id"], name: "index_polls_on_budget_id", unique: true, using: :btree - add_index "polls", ["starts_at", "ends_at"], name: "index_polls_on_starts_at_and_ends_at", using: :btree - create_table "progress_bar_translations", force: :cascade do |t| t.integer "progress_bar_id", null: false t.string "locale", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "title" + t.index ["locale"], name: "index_progress_bar_translations_on_locale", using: :btree + t.index ["progress_bar_id"], name: "index_progress_bar_translations_on_progress_bar_id", using: :btree end - add_index "progress_bar_translations", ["locale"], name: "index_progress_bar_translations_on_locale", using: :btree - add_index "progress_bar_translations", ["progress_bar_id"], name: "index_progress_bar_translations_on_progress_bar_id", using: :btree - create_table "progress_bars", force: :cascade do |t| t.integer "kind" t.integer "percentage" - t.integer "progressable_id" t.string "progressable_type" + t.integer "progressable_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false end @@ -1201,7 +1130,7 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.integer "cached_votes_up", default: 0 t.integer "comments_count", default: 0 t.datetime "confirmed_hide_at" - t.integer "hot_score", limit: 8, default: 0 + t.bigint "hot_score", default: 0 t.integer "confidence_score", default: 0 t.datetime "created_at", null: false t.datetime "updated_at", null: false @@ -1214,60 +1143,56 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "retired_reason" t.text "retired_explanation" t.integer "community_id" + t.index ["author_id", "hidden_at"], name: "index_proposals_on_author_id_and_hidden_at", using: :btree + t.index ["author_id"], name: "index_proposals_on_author_id", using: :btree + t.index ["cached_votes_up"], name: "index_proposals_on_cached_votes_up", using: :btree + t.index ["community_id"], name: "index_proposals_on_community_id", using: :btree + t.index ["confidence_score"], name: "index_proposals_on_confidence_score", using: :btree + t.index ["geozone_id"], name: "index_proposals_on_geozone_id", using: :btree + t.index ["hidden_at"], name: "index_proposals_on_hidden_at", using: :btree + t.index ["hot_score"], name: "index_proposals_on_hot_score", using: :btree + t.index ["question"], name: "index_proposals_on_question", using: :btree + t.index ["summary"], name: "index_proposals_on_summary", using: :btree + t.index ["title"], name: "index_proposals_on_title", using: :btree + t.index ["tsv"], name: "index_proposals_on_tsv", using: :gin end - add_index "proposals", ["author_id", "hidden_at"], name: "index_proposals_on_author_id_and_hidden_at", using: :btree - add_index "proposals", ["author_id"], name: "index_proposals_on_author_id", using: :btree - add_index "proposals", ["cached_votes_up"], name: "index_proposals_on_cached_votes_up", using: :btree - add_index "proposals", ["community_id"], name: "index_proposals_on_community_id", using: :btree - add_index "proposals", ["confidence_score"], name: "index_proposals_on_confidence_score", using: :btree - add_index "proposals", ["geozone_id"], name: "index_proposals_on_geozone_id", using: :btree - add_index "proposals", ["hidden_at"], name: "index_proposals_on_hidden_at", using: :btree - add_index "proposals", ["hot_score"], name: "index_proposals_on_hot_score", using: :btree - add_index "proposals", ["question"], name: "index_proposals_on_question", using: :btree - add_index "proposals", ["summary"], name: "index_proposals_on_summary", using: :btree - add_index "proposals", ["title"], name: "index_proposals_on_title", using: :btree - add_index "proposals", ["tsv"], name: "index_proposals_on_tsv", using: :gin - create_table "related_content_scores", force: :cascade do |t| t.integer "user_id" t.integer "related_content_id" t.integer "value" + t.index ["related_content_id"], name: "index_related_content_scores_on_related_content_id", using: :btree + t.index ["user_id", "related_content_id"], name: "unique_user_related_content_scoring", unique: true, using: :btree + t.index ["user_id"], name: "index_related_content_scores_on_user_id", using: :btree end - add_index "related_content_scores", ["related_content_id"], name: "index_related_content_scores_on_related_content_id", using: :btree - add_index "related_content_scores", ["user_id", "related_content_id"], name: "unique_user_related_content_scoring", unique: true, using: :btree - add_index "related_content_scores", ["user_id"], name: "index_related_content_scores_on_user_id", using: :btree - create_table "related_contents", force: :cascade do |t| - t.integer "parent_relationable_id" t.string "parent_relationable_type" - t.integer "child_relationable_id" + t.integer "parent_relationable_id" t.string "child_relationable_type" + t.integer "child_relationable_id" t.integer "related_content_id" t.datetime "created_at" t.datetime "updated_at" t.datetime "hidden_at" t.integer "related_content_scores_count", default: 0 t.integer "author_id" + t.index ["child_relationable_type", "child_relationable_id"], name: "index_related_contents_on_child_relationable", using: :btree + t.index ["hidden_at"], name: "index_related_contents_on_hidden_at", using: :btree + t.index ["parent_relationable_id", "parent_relationable_type", "child_relationable_id", "child_relationable_type"], name: "unique_parent_child_related_content", unique: true, using: :btree + t.index ["parent_relationable_type", "parent_relationable_id"], name: "index_related_contents_on_parent_relationable", using: :btree + t.index ["related_content_id"], name: "opposite_related_content", using: :btree end - add_index "related_contents", ["child_relationable_type", "child_relationable_id"], name: "index_related_contents_on_child_relationable", using: :btree - add_index "related_contents", ["hidden_at"], name: "index_related_contents_on_hidden_at", using: :btree - add_index "related_contents", ["parent_relationable_id", "parent_relationable_type", "child_relationable_id", "child_relationable_type"], name: "unique_parent_child_related_content", unique: true, using: :btree - add_index "related_contents", ["parent_relationable_type", "parent_relationable_id"], name: "index_related_contents_on_parent_relationable", using: :btree - add_index "related_contents", ["related_content_id"], name: "opposite_related_content", using: :btree - create_table "settings", force: :cascade do |t| t.string "key" t.string "value" + t.index ["key"], name: "index_settings_on_key", using: :btree end - add_index "settings", ["key"], name: "index_settings_on_key", using: :btree - create_table "signature_sheets", force: :cascade do |t| - t.integer "signable_id" t.string "signable_type" + t.integer "signable_id" t.text "document_numbers" t.boolean "processed", default: false t.integer "author_id" @@ -1290,10 +1215,9 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.text "body" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["name", "locale"], name: "index_site_customization_content_blocks_on_name_and_locale", unique: true, using: :btree end - add_index "site_customization_content_blocks", ["name", "locale"], name: "index_site_customization_content_blocks_on_name_and_locale", unique: true, using: :btree - create_table "site_customization_images", force: :cascade do |t| t.string "name", null: false t.string "image_file_name" @@ -1302,10 +1226,9 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "image_updated_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["name"], name: "index_site_customization_images_on_name", unique: true, using: :btree end - add_index "site_customization_images", ["name"], name: "index_site_customization_images_on_name", unique: true, using: :btree - create_table "site_customization_page_translations", force: :cascade do |t| t.integer "site_customization_page_id", null: false t.string "locale", null: false @@ -1314,11 +1237,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "title" t.string "subtitle" t.text "content" + t.index ["locale"], name: "index_site_customization_page_translations_on_locale", using: :btree + t.index ["site_customization_page_id"], name: "index_7fa0f9505738cb31a31f11fb2f4c4531fed7178b", using: :btree end - add_index "site_customization_page_translations", ["locale"], name: "index_site_customization_page_translations_on_locale", using: :btree - add_index "site_customization_page_translations", ["site_customization_page_id"], name: "index_7fa0f9505738cb31a31f11fb2f4c4531fed7178b", using: :btree - create_table "site_customization_pages", force: :cascade do |t| t.string "slug", null: false t.string "title" @@ -1340,7 +1262,7 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "geozone_id" - t.integer "price", limit: 8 + t.bigint "price" t.boolean "feasible" t.string "association_name" t.text "price_explanation" @@ -1350,32 +1272,30 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.text "explanations_log" t.integer "administrator_id" t.integer "valuation_assignments_count", default: 0 - t.integer "price_first_year", limit: 8 + t.bigint "price_first_year" t.string "time_scope" t.datetime "unfeasible_email_sent_at" t.integer "cached_votes_up", default: 0 t.tsvector "tsv" t.string "responsible_name", limit: 60 t.integer "physical_votes", default: 0 + t.index ["author_id"], name: "index_spending_proposals_on_author_id", using: :btree + t.index ["geozone_id"], name: "index_spending_proposals_on_geozone_id", using: :btree + t.index ["tsv"], name: "index_spending_proposals_on_tsv", using: :gin end - add_index "spending_proposals", ["author_id"], name: "index_spending_proposals_on_author_id", using: :btree - add_index "spending_proposals", ["geozone_id"], name: "index_spending_proposals_on_geozone_id", using: :btree - add_index "spending_proposals", ["tsv"], name: "index_spending_proposals_on_tsv", using: :gin - create_table "taggings", force: :cascade do |t| t.integer "tag_id" - t.integer "taggable_id" t.string "taggable_type" - t.integer "tagger_id" + t.integer "taggable_id" t.string "tagger_type" + t.integer "tagger_id" t.string "context", limit: 128 t.datetime "created_at" + t.index ["tag_id"], name: "index_taggings_on_tag_id", using: :btree + t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree end - add_index "taggings", ["tag_id"], name: "index_taggings_on_tag_id", using: :btree - add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree - create_table "tags", force: :cascade do |t| t.string "name", limit: 160 t.integer "taggings_count", default: 0 @@ -1386,15 +1306,14 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.integer "budget/investments_count", default: 0 t.integer "legislation/proposals_count", default: 0 t.integer "legislation/processes_count", default: 0 + t.index ["debates_count"], name: "index_tags_on_debates_count", using: :btree + t.index ["legislation/processes_count"], name: "index_tags_on_legislation/processes_count", using: :btree + t.index ["legislation/proposals_count"], name: "index_tags_on_legislation/proposals_count", using: :btree + t.index ["name"], name: "index_tags_on_name", unique: true, using: :btree + t.index ["proposals_count"], name: "index_tags_on_proposals_count", using: :btree + t.index ["spending_proposals_count"], name: "index_tags_on_spending_proposals_count", using: :btree end - add_index "tags", ["debates_count"], name: "index_tags_on_debates_count", using: :btree - add_index "tags", ["legislation/processes_count"], name: "index_tags_on_legislation/processes_count", using: :btree - add_index "tags", ["legislation/proposals_count"], name: "index_tags_on_legislation/proposals_count", using: :btree - add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree - add_index "tags", ["proposals_count"], name: "index_tags_on_proposals_count", using: :btree - add_index "tags", ["spending_proposals_count"], name: "index_tags_on_spending_proposals_count", using: :btree - create_table "topics", force: :cascade do |t| t.string "title", null: false t.text "description" @@ -1404,11 +1323,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "hidden_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["community_id"], name: "index_topics_on_community_id", using: :btree + t.index ["hidden_at"], name: "index_topics_on_hidden_at", using: :btree end - add_index "topics", ["community_id"], name: "index_topics_on_community_id", using: :btree - add_index "topics", ["hidden_at"], name: "index_topics_on_hidden_at", using: :btree - create_table "users", force: :cascade do |t| t.string "email", default: "" t.string "encrypted_password", default: "", null: false @@ -1470,16 +1388,15 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.boolean "public_interests", default: false t.boolean "recommended_debates", default: true t.boolean "recommended_proposals", default: true + t.index ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree + t.index ["email"], name: "index_users_on_email", unique: true, using: :btree + t.index ["geozone_id"], name: "index_users_on_geozone_id", using: :btree + t.index ["hidden_at"], name: "index_users_on_hidden_at", using: :btree + t.index ["password_changed_at"], name: "index_users_on_password_changed_at", using: :btree + t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree + t.index ["username"], name: "index_users_on_username", using: :btree end - add_index "users", ["confirmation_token"], name: "index_users_on_confirmation_token", unique: true, using: :btree - add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree - add_index "users", ["geozone_id"], name: "index_users_on_geozone_id", using: :btree - add_index "users", ["hidden_at"], name: "index_users_on_hidden_at", using: :btree - add_index "users", ["password_changed_at"], name: "index_users_on_password_changed_at", using: :btree - add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true, using: :btree - add_index "users", ["username"], name: "index_users_on_username", using: :btree - create_table "valuation_assignments", force: :cascade do |t| t.integer "valuator_id" t.integer "spending_proposal_id" @@ -1498,10 +1415,9 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.integer "spending_proposals_count", default: 0 t.integer "budget_investments_count", default: 0 t.integer "valuator_group_id" + t.index ["user_id"], name: "index_valuators_on_user_id", using: :btree end - add_index "valuators", ["user_id"], name: "index_valuators_on_user_id", using: :btree - create_table "verified_users", force: :cascade do |t| t.string "document_number" t.string "document_type" @@ -1509,12 +1425,11 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "email" t.datetime "created_at", null: false t.datetime "updated_at", null: false + t.index ["document_number"], name: "index_verified_users_on_document_number", using: :btree + t.index ["email"], name: "index_verified_users_on_email", using: :btree + t.index ["phone"], name: "index_verified_users_on_phone", using: :btree end - add_index "verified_users", ["document_number"], name: "index_verified_users_on_document_number", using: :btree - add_index "verified_users", ["email"], name: "index_verified_users_on_email", using: :btree - add_index "verified_users", ["phone"], name: "index_verified_users_on_phone", using: :btree - create_table "visits", id: :uuid, default: nil, force: :cascade do |t| t.uuid "visitor_id" t.string "ip" @@ -1541,28 +1456,26 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "utm_content" t.string "utm_campaign" t.datetime "started_at" + t.index ["started_at"], name: "index_visits_on_started_at", using: :btree + t.index ["user_id"], name: "index_visits_on_user_id", using: :btree end - add_index "visits", ["started_at"], name: "index_visits_on_started_at", using: :btree - add_index "visits", ["user_id"], name: "index_visits_on_user_id", using: :btree - create_table "votes", force: :cascade do |t| - t.integer "votable_id" t.string "votable_type" - t.integer "voter_id" + t.integer "votable_id" t.string "voter_type" + t.integer "voter_id" t.boolean "vote_flag" t.string "vote_scope" t.integer "vote_weight" t.datetime "created_at" t.datetime "updated_at" t.integer "signature_id" + t.index ["signature_id"], name: "index_votes_on_signature_id", using: :btree + t.index ["votable_id", "votable_type", "vote_scope"], name: "index_votes_on_votable_id_and_votable_type_and_vote_scope", using: :btree + t.index ["voter_id", "voter_type", "vote_scope"], name: "index_votes_on_voter_id_and_voter_type_and_vote_scope", using: :btree end - add_index "votes", ["signature_id"], name: "index_votes_on_signature_id", using: :btree - add_index "votes", ["votable_id", "votable_type", "vote_scope"], name: "index_votes_on_votable_id_and_votable_type_and_vote_scope", using: :btree - add_index "votes", ["voter_id", "voter_type", "vote_scope"], name: "index_votes_on_voter_id_and_voter_type_and_vote_scope", using: :btree - create_table "web_sections", force: :cascade do |t| t.text "name" t.datetime "created_at", null: false @@ -1578,11 +1491,10 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.string "title" t.text "description" t.string "link_text" + t.index ["locale"], name: "index_widget_card_translations_on_locale", using: :btree + t.index ["widget_card_id"], name: "index_widget_card_translations_on_widget_card_id", using: :btree end - add_index "widget_card_translations", ["locale"], name: "index_widget_card_translations_on_locale", using: :btree - add_index "widget_card_translations", ["widget_card_id"], name: "index_widget_card_translations_on_widget_card_id", using: :btree - create_table "widget_cards", force: :cascade do |t| t.string "title" t.text "description" @@ -1594,10 +1506,9 @@ ActiveRecord::Schema.define(version: 20190205131722) do t.datetime "updated_at", null: false t.integer "site_customization_page_id" t.integer "columns", default: 4 + t.index ["site_customization_page_id"], name: "index_widget_cards_on_site_customization_page_id", using: :btree end - add_index "widget_cards", ["site_customization_page_id"], name: "index_widget_cards_on_site_customization_page_id", using: :btree - create_table "widget_feeds", force: :cascade do |t| t.string "kind" t.integer "limit", default: 3 From 65c30c8d2db156debcf6c266214b9b89efcf542a Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Mon, 1 Apr 2019 19:33:07 +0200 Subject: [PATCH 098/104] Remove migrations warning DEPRECATION WARNING: Directly inheriting from ActiveRecord::Migration is deprecated. Please specify the Rails release the migration was written for: class MigrationClass < ActiveRecord::Migration[4.2] (called from require at bin/rails:4) --- db/migrate/20150715190041_create_debates.rb | 2 +- .../20150716154501_remove_external_link_from_debates.rb | 2 +- db/migrate/20150716174358_devise_create_users.rb | 2 +- .../20150717164054_add_first_name_and_last_name_to_users.rb | 2 +- db/migrate/20150717180105_acts_as_votable_migration.rb | 2 +- ...cts_as_taggable_on_migration.acts_as_taggable_on_engine.rb | 2 +- ...ggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb | 2 +- ...0718091702_acts_as_commentable_with_threading_migration.rb | 2 +- .../20150731110702_add_confirmable_to_devise_for_users.rb | 2 +- db/migrate/20150804144230_create_visits.rb | 2 +- db/migrate/20150804144231_create_ahoy_events.rb | 2 +- db/migrate/20150806111435_change_debates_title_length.rb | 2 +- db/migrate/20150806135245_add_nickname_to_user.rb | 2 +- db/migrate/20150806140048_add_use_nickname_to_users.rb | 2 +- db/migrate/20150806163142_add_preferences_to_users.rb | 2 +- db/migrate/20150807140235_create_administrators.rb | 2 +- db/migrate/20150807140346_create_moderators.rb | 2 +- db/migrate/20150808100936_add_ip_to_ahoy_event.rb | 2 +- db/migrate/20150808102442_add_visit_id_to_debate.rb | 2 +- db/migrate/20150808141306_create_simple_captcha_data.rb | 2 +- db/migrate/20150810201448_add_hidden_at_to_comments.rb | 2 +- db/migrate/20150811145628_add_hidden_at_to_debates.rb | 2 +- db/migrate/20150811161459_add_children_count_to_comments.rb | 2 +- db/migrate/20150813142213_create_organizations.rb | 2 +- db/migrate/20150813161654_add_phone_number_to_users.rb | 2 +- db/migrate/20150814074250_add_official_position_to_user.rb | 2 +- db/migrate/20150815154430_add_featured_to_tags.rb | 2 +- db/migrate/20150817150457_add_settings.rb | 2 +- db/migrate/20150819135933_add_hidden_at_to_users.rb | 2 +- .../20150819193457_add_sms_verification_code_to_users.rb | 2 +- db/migrate/20150819203410_add_phone_to_users.rb | 2 +- db/migrate/20150820103351_create_inappropiate_flags.rb | 2 +- ...20150820103800_add_inappropiate_flag_fields_to_comments.rb | 2 +- .../20150820104552_add_inappropiate_flag_fields_to_debates.rb | 2 +- .../20150821130019_changes_user_registrations_fields.rb | 2 +- db/migrate/20150821180131_add_reviewed_at_to_comments.rb | 2 +- db/migrate/20150821180155_add_reviewed_at_to_debates.rb | 2 +- db/migrate/20150822095305_create_verified_users.rb | 2 +- db/migrate/20150822100557_add_document_to_users.rb | 2 +- .../20150822132547_add_residence_verified_at_to_users.rb | 2 +- db/migrate/20150823111403_add_letter_to_users.rb | 2 +- db/migrate/20150823114519_add_email_verified_at_to_users.rb | 2 +- db/migrate/20150823121109_add_email_verification_to_users.rb | 2 +- ...150824110104_add_verified_user_sms_verified_at_to_users.rb | 2 +- db/migrate/20150824111844_add_moderator_id_to_comment.rb | 2 +- db/migrate/20150824113326_add_administrator_id_to_comment.rb | 2 +- db/migrate/20150824144524_create_identities.rb | 2 +- .../20150825124821_adds_votable_cache_field_to_comments.rb | 2 +- .../20150825124827_adds_votable_cache_field_to_debates.rb | 2 +- db/migrate/20150825165517_add_sms_tried_to_users.rb | 2 +- ...0150825175647_add_residence_verification_tries_to_users.rb | 2 +- db/migrate/20150825201922_create_addresses.rb | 2 +- ...name_reviewed_at_to_archived_at_in_comments_and_debates.rb | 2 +- db/migrate/20150826112500_add_comments_count_to_debate.rb | 2 +- db/migrate/20150826182010_refactor_verification_columns.rb | 2 +- .../20150827080624_rename_inappropiate_flags_as_flags.rb | 2 +- ..._archived_at_to_ignored_flag_at_in_comments_and_debates.rb | 2 +- ...827080701_add_confirmed_hide_at_to_comments_and_debates.rb | 2 +- ...iate_flags_count_to_flags_count_in_debates_and_comments.rb | 2 +- ...ve_flagged_as_inappropiate_at_from_comments_and_debates.rb | 2 +- db/migrate/20150828085718_add_confirmed_hide_at_to_users.rb | 2 +- ...150830212600_add_cached_anonymous_votes_total_to_debate.rb | 2 +- db/migrate/20150902114558_add_ancestry_to_comments.rb | 2 +- db/migrate/20150902120006_remove_parent_id_from_comments.rb | 2 +- .../20150902191315_add_letter_verification_code_to_users.rb | 2 +- .../20150903142924_remove_children_count_from_comments.rb | 2 +- db/migrate/20150903155146_add_cached_votes_score_to_debate.rb | 2 +- db/migrate/20150903171309_add_hot_score_to_debates.rb | 2 +- db/migrate/20150903200440_create_delayed_jobs.rb | 2 +- db/migrate/20150907064631_add_hot_score_index_to_debates.rb | 2 +- db/migrate/20150908102936_add_confidence_score_to_debates.rb | 2 +- db/migrate/20150909131133_set_username_limit.rb | 2 +- db/migrate/20150909135032_remove_comment_title.rb | 2 +- db/migrate/20150909142534_set_organization_name_limit.rb | 2 +- db/migrate/20150909153455_set_tag_name_limit.rb | 2 +- db/migrate/20150909211203_create_failed_census_calls.rb | 2 +- .../20150910092713_add_letter_verification_tries_to_users.rb | 2 +- db/migrate/20150910133047_create_locks.rb | 2 +- .../20150910152734_remove_verification_tries_from_users.rb | 2 +- db/migrate/20150911171301_create_proposal.rb | 2 +- .../20150912145218_add_responsible_name_to_organizations.rb | 2 +- db/migrate/20150914113251_add_responsible_to_proposals.rb | 2 +- .../20150914114019_change_email_config_field_in_user.rb | 2 +- db/migrate/20150914173834_add_summary_to_proposals.rb | 2 +- db/migrate/20150914181921_add_more_indexes_for_ahoy.rb | 2 +- db/migrate/20150914182652_adds_indexes.rb | 2 +- db/migrate/20150914184018_add_indexes_for_searches.rb | 2 +- db/migrate/20150914191003_add_video_url_to_proposal.rb | 2 +- db/migrate/20150917102718_add_extra_counters_to_tags.rb | 2 +- db/migrate/20150921095553_create_activities.rb | 2 +- ...24112929_add_failed_census_calls_counter_cache_to_users.rb | 2 +- db/migrate/20150926113052_drop_addresses_table.rb | 2 +- .../20150926115929_adds_resilient_locked_until_default.rb | 2 +- db/migrate/20150928115005_create_notifications.rb | 2 +- db/migrate/20150930082311_create_managers.rb | 2 +- .../20151002144206_add_unconfirmed_document_number_to_user.rb | 2 +- ...1013145126_remove_unconfirmed_document_number_from_user.rb | 2 +- .../20151013145757_add_level_two_verified_at_to_users.rb | 2 +- db/migrate/20151015135154_destroy_manager.rb | 2 +- db/migrate/20151016110703_add_erase_reason_to_users.rb | 2 +- db/migrate/20151019133719_remove_user_constraints.rb | 2 +- db/migrate/20151020112354_remove_letter_sent_at_from_users.rb | 2 +- db/migrate/20151020135111_create_campaigns.rb | 2 +- db/migrate/20151021113348_add_erased_at_to_users.rb | 2 +- db/migrate/20151028145921_add_confidence_score_to_comments.rb | 2 +- db/migrate/20151028213830_add_unaccent_extension.rb | 2 +- db/migrate/20151028221647_add_pg_trgm_extension.rb | 2 +- db/migrate/20151030182217_add_physical_votes_to_proposals.rb | 2 +- ...51103175139_make_comments_confidence_score_default_to_0.rb | 2 +- db/migrate/20151103194329_add_public_activity_to_users.rb | 2 +- db/migrate/20151111202657_adds_tsvector_update_trigger.rb | 2 +- db/migrate/20151117222604_create_annotations.rb | 2 +- db/migrate/20151117225104_add_proposals_to_annotations.rb | 2 +- db/migrate/20151118160928_add_user_to_annotations.rb | 2 +- db/migrate/20151215113827_create_legislations.rb | 2 +- .../20151215115319_add_legislation_id_to_annotations.rb | 2 +- .../20151215165824_add_newsletter_subscription_to_users.rb | 2 +- db/migrate/20151218114205_create_spending_proposals.rb | 2 +- .../20160104203329_add_spending_proposals_counter_to_tags.rb | 2 +- db/migrate/20160104203438_add_spending_proposals_indexes.rb | 2 +- db/migrate/20160105121132_create_geozones.rb | 2 +- .../20160105170113_merge_activities_and_notifications.rb | 2 +- db/migrate/20160107114749_add_geozone_to_spending_proposal.rb | 2 +- .../20160107132059_add_resolution_to_spending_proposals.rb | 2 +- db/migrate/20160108114750_add_counter_to_notifications.rb | 2 +- .../20160108133501_add_notifications_counter_cache_to_user.rb | 2 +- db/migrate/20160114110933_create_tolk_tables.rb | 4 ++-- db/migrate/20160119132601_add_kind_to_tags.rb | 2 +- .../20160119164320_add_registering_with_oauth_to_users.rb | 2 +- .../20160122124847_add_geozone_to_proposals_and_debates.rb | 2 +- db/migrate/20160122153329_add_locale_to_users.rb | 2 +- .../20160125100637_add_confirmed_oauth_email_to_user.rb | 2 +- ...60126090634_rename_confirmed_oauth_email_to_oauth_email.rb | 2 +- db/migrate/20160204134022_add_tsvector_to_debates.rb | 4 ++-- db/migrate/20160207205252_add_external_link_to_debates.rb | 4 ++-- ...0160216121051_add_reporting_fields_to_spending_proposal.rb | 4 ++-- db/migrate/20160217101004_create_valuators.rb | 2 +- db/migrate/20160218164923_add_geozone_id_to_users.rb | 2 +- db/migrate/20160218172620_add_census_code_to_geozones.rb | 2 +- .../20160219111057_add_district_code_to_failed_census_call.rb | 2 +- .../20160219172824_removes_external_link_from_debates.rb | 2 +- .../20160220181602_add_association_to_spending_proposals.rb | 2 +- db/migrate/20160222145100_add_redeemable_code_to_user.rb | 2 +- db/migrate/20160224101038_change_spending_proposals_fields.rb | 2 +- db/migrate/20160224123110_create_valuation_assignments.rb | 2 +- ...1916_add_assignments_counter_cache_to_spending_proposal.rb | 2 +- .../20160305113707_add_price_fields_to_spending_proposals.rb | 2 +- .../20160307150804_add_time_scope_to_spending_proposals.rb | 2 +- ...0160308103548_change_price_fields_in_spending_proposals.rb | 2 +- db/migrate/20160308184050_change_price_fields_to_bigint.rb | 2 +- db/migrate/20160315084335_add_featured_at_to_debates.rb | 2 +- db/migrate/20160315092854_add_description_to_valuators.rb | 2 +- ...2843_add_unfeasible_email_sent_at_to_spending_proposals.rb | 2 +- .../20160329115418_add_votes_up_to_spending_proposals.rb | 2 +- .../20160329160106_add_tsvector_to_spending_proposals.rb | 4 ++-- ...160406163649_add_responsible_name_to_spending_proposals.rb | 2 +- db/migrate/20160411161531_add_genre_and_dob_to_users.rb | 2 +- db/migrate/20160413122359_rename_genre_to_gender.rb | 2 +- ...20160415150524_add_physical_votes_to_spending_proposals.rb | 2 +- db/migrate/20160418144013_add_index_to_username.rb | 2 +- db/migrate/20160418172919_activate_newsletter_by_default.rb | 2 +- db/migrate/20160420105023_add_retired_to_proposals.rb | 2 +- db/migrate/20160421090733_destroy_captcha_table.rb | 2 +- db/migrate/20160422094733_add_retired_texts_to_proposals.rb | 2 +- ...160426211658_add_assignments_counter_cache_to_valuators.rb | 2 +- db/migrate/20160510161858_create_manager_role.rb | 2 +- db/migrate/20160518141543_create_banners.rb | 4 ++-- db/migrate/20160518142529_create_budgets.rb | 2 +- db/migrate/20160518151245_create_budget_investments.rb | 2 +- db/migrate/20160519144152_create_budget_ballots.rb | 2 +- db/migrate/20160520100347_create_budget_ballot_lines.rb | 2 +- db/migrate/20160520111735_create_budget_heading.rb | 2 +- .../20160520114820_replace_geozones_by_headings_in_budgets.rb | 2 +- db/migrate/20160520151954_add_budget_id_to_investments.rb | 2 +- .../20160523095730_create_budget_valuator_assignments.rb | 2 +- db/migrate/20160523143320_deletes_heading_id_from_ballot.rb | 2 +- ...0160523144313_add_budget_investments_count_to_valuators.rb | 2 +- db/migrate/20160523150146_rename_bi_valuation_count.rb | 2 +- ...160523164449_add_responsible_name_to_budget_investments.rb | 2 +- db/migrate/20160524143107_add_heading_id_to_budget_ballot.rb | 2 +- db/migrate/20160524144005_add_price_to_budget.rb | 2 +- .../20160531102008_add_budget_investments_count_to_tags.rb | 2 +- db/migrate/20160601103338_create_proposal_notifications.rb | 2 +- ...60606102427_add_email_on_proposal_notification_to_users.rb | 2 +- db/migrate/20160608174104_create_direct_messages.rb | 2 +- db/migrate/20160609110023_create_budget_group.rb | 2 +- db/migrate/20160609142017_remove_price_from_budget.rb | 2 +- .../20160609152026_remove_budget_id_from_investments.rb | 2 +- db/migrate/20160610094658_desnormalize_ballot_line.rb | 2 +- db/migrate/20160613150659_add_email_digest_to_users.rb | 2 +- db/migrate/20160614091639_remove_heading_id_from_ballot.rb | 2 +- .../20160614160949_add_email_on_direct_messages_to_users.rb | 2 +- db/migrate/20160617172616_add_badge_to_users.rb | 2 +- db/migrate/20160803154011_add_emailed_at_to_notifications.rb | 2 +- db/migrate/20160901104320_add_password_expired.rb | 2 +- db/migrate/20160905092539_denormalize_investments.rb | 2 +- db/migrate/20160914110004_create_polls.rb | 2 +- db/migrate/20160914110039_create_poll_officers.rb | 2 +- db/migrate/20160914172016_create_poll_voters.rb | 2 +- db/migrate/20160914172535_create_poll_booths.rb | 2 +- db/migrate/20160926090107_add_location_to_booths.rb | 2 +- db/migrate/20160928113143_create_officing_booths.rb | 2 +- db/migrate/20161020112156_add_dates_to_polls.rb | 2 +- db/migrate/20161028104156_create_poll_questions.rb | 2 +- db/migrate/20161028143204_create_geozones_poll_questions.rb | 2 +- db/migrate/20161102133838_default_password_changed_at.rb | 2 +- .../20161107124207_add_all_geozones_to_poll_questions.rb | 2 +- db/migrate/20161107174423_create_poll_partial_result.rb | 2 +- ...161117115841_rename_legislations_to_legacy_legislations.rb | 2 +- db/migrate/20161117135624_create_legislation_processes.rb | 2 +- .../20161122101702_remove_question_from_poll_questions.rb | 2 +- db/migrate/20161129011737_add_tsv_to_poll_questions.rb | 2 +- db/migrate/20161130122604_remove_poll_id_from_booth.rb | 2 +- db/migrate/20161130123347_create_poll_booth_assignments.rb | 2 +- .../20161205110441_create_legislation_draft_versions.rb | 2 +- db/migrate/20161206130836_delete_officing_booths.rb | 2 +- db/migrate/20161206131125_create_poll_officer_assignments.rb | 2 +- .../20161206132126_rename_booth_id_to_booth_assignment_id.rb | 2 +- db/migrate/20161207181001_remove_poll_id_from_voter.rb | 2 +- db/migrate/20161213144031_add_body_html_to_draft_versions.rb | 2 +- db/migrate/20161214212918_create_signature_sheets.rb | 4 ++-- db/migrate/20161214233817_create_signatures.rb | 2 +- db/migrate/20161220120037_create_legislation_questions.rb | 2 +- db/migrate/20161221131403_add_signture_id_to_votes.rb | 2 +- .../20161221151239_add_created_from_signature_to_users.rb | 2 +- .../20161221172447_add_selected_to_budget_investment.rb | 2 +- db/migrate/20161222115744_create_legislation_answers.rb | 2 +- ...61222171716_add_comments_count_to_legislation_questions.rb | 2 +- .../20161222180927_add_author_to_legislation_questions.rb | 2 +- db/migrate/20161227140109_add_date_to_officer_assignment.rb | 2 +- .../20161229110336_remove_physical_votes_from_proposals.rb | 2 +- .../20161229153505_add_location_to_budget_investments.rb | 2 +- db/migrate/20161229213217_add_toc_html_to_draft_versions.rb | 2 +- db/migrate/20161230172816_remove_valuating_from_budgets.rb | 2 +- db/migrate/20161230174744_change_budget_description.rb | 2 +- db/migrate/20170102080432_adjust_budget_fields.rb | 2 +- db/migrate/20170102114446_create_poll_recounts.rb | 2 +- db/migrate/20170102170125_add_published_to_polls.rb | 2 +- db/migrate/20170103125835_create_legislation_annotations.rb | 2 +- .../20170103170147_remove_geozone_id_from_budget_headings.rb | 2 +- ...11_add_date_and_officer_assignment_log_to_poll_recounts.rb | 2 +- ...0105120836_add_comments_count_to_legislation_annotation.rb | 2 +- ...212047_rename_user_to_author_in_legislation_annotations.rb | 2 +- .../20170105215410_add_failed_email_digests_count_to_users.rb | 2 +- ...130838_add_organization_name_field_to_budget_investment.rb | 2 +- ...4421_add_unfeasible_email_sent_at_to_budget_investments.rb | 2 +- ...170120153244_move_geozones_from_poll_questions_to_polls.rb | 2 +- db/migrate/20170120161058_add_geozone_restricted_to_polls.rb | 2 +- .../20170120164547_remove_all_geozones_from_poll_questions.rb | 2 +- ...0125093101_add_ranges_fields_to_legislation_annotations.rb | 2 +- ...170125104542_add_poll_id_and_stats_fields_to_poll_voter.rb | 2 +- db/migrate/20170125112017_create_poll_answers.rb | 2 +- db/migrate/20170125114952_add_answer_id_to_poll_voters.rb | 2 +- db/migrate/20170127173553_add_officer_assignment_to_votes.rb | 2 +- db/migrate/20170128214244_adds_user_id_to_poll_voters.rb | 2 +- db/migrate/20170130101121_create_poll_final_recount.rb | 2 +- .../20170130103550_add_final_to_poll_officer_assignments.rb | 2 +- db/migrate/20170130133736_add_date_to_final_recount.rb | 2 +- ...30_change_datetimes_to_date_in_recounts_and_assignments.rb | 2 +- .../20170130171322_remove_summary_from_poll_question.rb | 2 +- .../20170201113206_adds_fields_to_poll_partial_results.rb | 2 +- .../20170202151151_add_log_fields_to_poll_partial_results.rb | 2 +- db/migrate/20170203163304_create_poll_white_results.rb | 2 +- db/migrate/20170203163317_create_poll_null_results.rb | 2 +- .../20170208110146_add_officer_id_to_failed_census_calls.rb | 2 +- ...08111639_add_failed_census_calls_count_to_poll_officers.rb | 2 +- ...20170208112814_add_year_of_birth_to_failed_census_calls.rb | 2 +- ...208114548_add_user_data_log_to_poll_officer_assignments.rb | 2 +- .../20170208160130_add_former_users_data_log_to_users.rb | 2 +- .../20170210083026_add_context_for_legislation_annotations.rb | 2 +- db/migrate/20170212123435_add_polls_related_indexes.rb | 2 +- db/migrate/20170316174351_create_site_customization_pages.rb | 2 +- db/migrate/20170322145702_create_site_customization_images.rb | 2 +- ...20170324101716_create_site_customization_content_blocks.rb | 2 +- db/migrate/20170427145845_change_budget_name.rb | 2 +- .../20170428111355_add_ballot_line_count_to_investments.rb | 2 +- db/migrate/20170503163330_add_uniq_index_for_ballot_lines.rb | 2 +- .../20170513110025_add_previous_heading_id_to_investments.rb | 2 +- db/migrate/20170517123042_create_budget_reclassified_votes.rb | 2 +- db/migrate/20170519084239_add_winner_to_budget_investments.rb | 2 +- .../20170602162155_add_summary_to_legislative_process.rb | 2 +- ...11027_remove_ht_participate_and_target_from_leg_process.rb | 2 +- ...4317_rename_legislation_process_final_pub_to_result_pub.rb | 2 +- ...256_add_phase_pub_enabled_status_to_legislative_process.rb | 2 +- .../20170620132731_create_budget_investment_milestones.rb | 2 +- .../20170621180611_add_population_to_budget_headings.rb | 2 +- db/migrate/20170623141655_remove_featured_from_tags.rb | 2 +- .../20170626081337_add_published_to_legislation_processes.rb | 2 +- db/migrate/20170626180127_create_follows.rb | 2 +- db/migrate/20170627113331_create_images.rb | 2 +- db/migrate/20170630105250_add_public_interests_to_user.rb | 2 +- .../20170702105956_add_locale_to_site_customization_pages.rb | 2 +- .../20170703120055_add_incompatible_to_budget_investments.rb | 2 +- .../20170704105112_add_slugs_to_budget_heading_group.rb | 2 +- db/migrate/20170708174932_create_local_census_records.rb | 2 +- db/migrate/20170708225159_remove_tolk.rb | 2 +- .../20170713110317_remove_local_census_record_user_id.rb | 2 +- db/migrate/20170719174326_remove_poll_recount.rb | 2 +- db/migrate/20170720092638_create_documents.rb | 2 +- db/migrate/20170724190805_create_poll_shifts.rb | 2 +- db/migrate/20170804170049_create_community.rb | 2 +- db/migrate/20170804171325_add_community_to_proposal.rb | 2 +- db/migrate/20170805132736_create_map_locations.rb | 2 +- db/migrate/20170807082243_create_topics.rb | 2 +- .../20170822144743_add_community_to_budget_investments.rb | 2 +- db/migrate/20170905111444_add_video_url_to_poll_questions.rb | 2 +- db/migrate/20170908175149_add_officer_data_to_poll_shifts.rb | 2 +- db/migrate/20170911110109_add_user_id_to_images.rb | 2 +- ...0913101029_add_proposals_phase_to_legislation_processes.rb | 2 +- ...0803_add_proposals_description_to_legislation_processes.rb | 2 +- db/migrate/20170914102634_create_legislation_proposals.rb | 2 +- db/migrate/20170914114427_create_poll_total_results.rb | 2 +- db/migrate/20170914154743_fix_password_changed_at_default.rb | 2 +- .../20170915101519_add_legislation_proposals_count_to_tags.rb | 2 +- db/migrate/20170918231410_remove_poll_final_recounts.rb | 2 +- .../20170922101247_add_legislation_processes_count_to_tags.rb | 2 +- db/migrate/20170927110953_add_shift_task.rb | 2 +- .../20170928132402_add_summary_and_description_to_polls.rb | 2 +- db/migrate/20171002103314_add_poll_shift_task_index.rb | 2 +- db/migrate/20171002121658_add_origin_to_poll_voters.rb | 2 +- db/migrate/20171002122312_create_poll_recount.rb | 2 +- .../20171002133547_remove_poll_white_null_total_results.rb | 2 +- db/migrate/20171002191347_add_default_to_recount_amounts.rb | 2 +- .../20171003095936_remove_officer_assigment_composed_index.rb | 2 +- db/migrate/20171003143034_add_comments_count_to_polls.rb | 2 +- .../20171003170029_remove_description_from_poll_questions.rb | 2 +- .../20171003212958_add_date_to_poll_shift_composed_index.rb | 2 +- db/migrate/20171003223152_add_officer_to_poll_voter.rb | 2 +- db/migrate/20171004025903_create_poll_question_answers.rb | 2 +- .../20171004151553_rename_poll_question_id_to_question_id.rb | 2 +- .../20171004210108_create_poll_question_answer_videos.rb | 2 +- db/migrate/20171006145053_add_token_to_poll_voters.rb | 2 +- ...20171010143623_add_given_order_to_poll_question_answers.rb | 2 +- .../20171017221546_remove_poll_question_valid_answers.rb | 2 +- .../20171019095042_add_most_voted_to_poll_question_answer.rb | 2 +- db/migrate/20171020163240_add_results_and_stats_to_polls.rb | 2 +- ...0171025142440_add_cached_votes_to_legislation_proposals.rb | 2 +- .../20171115164152_add_time_zone_to_default_datetimes.rb | 2 +- db/migrate/20171127171925_create_related_content.rb | 2 +- .../20171127230716_add_time_reported_to_related_content.rb | 2 +- .../20171212154048_add_publication_date_to_milestones.rb | 2 +- db/migrate/20171212193323_add_timestamps_to_polls.rb | 2 +- ...1215152244_change_related_content_times_reported_column.rb | 2 +- .../20171219111046_remove_related_contents_flags_count.rb | 2 +- db/migrate/20171219184209_create_related_content_scores.rb | 2 +- .../20171219235102_add_hidden_at_to_related_contents.rb | 2 +- ...2_add_related_content_scores_counter_to_related_content.rb | 2 +- db/migrate/20171220010000_add_author_to_related_content.rb | 2 +- db/migrate/20180108182839_add_drafting_phase_to_budget.rb | 2 +- db/migrate/20180109081115_add_settings_to_banners.rb | 2 +- db/migrate/20180109101656_create_banner_sections.rb | 2 +- .../20180109175851_add_publishing_prices_phase_to_budget.rb | 2 +- db/migrate/20180112123641_create_budget_phases.rb | 2 +- db/migrate/20180115075542_create_web_sections.rb | 2 +- ...116151008_add_visible_to_valuators_to_budget_investment.rb | 2 +- .../20180119073228_add_description_informing_to_budgets.rb | 2 +- .../20180124143013_remove_image_and_style_from_banners.rb | 2 +- db/migrate/20180129190931_add_valuation_flag_to_comments.rb | 2 +- db/migrate/20180129190950_add_index_to_valuation_comments.rb | 2 +- ...20180131011426_remove_internal_comments_from_investment.rb | 2 +- db/migrate/20180205170054_create_newsletters.rb | 2 +- db/migrate/20180208151658_create_valuator_groups.rb | 2 +- db/migrate/20180208163135_add_valuator_group_to_valuators.rb | 2 +- .../20180208200659_create_budget_valuator_group_assignment.rb | 2 +- ...11182635_add_budget_valuator_group_assignments_counters.rb | 2 +- ...220211105_change_newsletter_segment_recipient_to_string.rb | 2 +- db/migrate/20180221002503_create_admin_notifications.rb | 2 +- db/migrate/20180222120017_add_read_at_to_notifications.rb | 2 +- ...0180320104823_add_max_votable_headings_to_budget_groups.rb | 2 +- .../20180321140337_create_budget_investment_statuses.rb | 2 +- db/migrate/20180321180149_add_status_to_milestones.rb | 2 +- db/migrate/20180323190027_add_translate_milestones.rb | 2 +- db/migrate/20180516091302_create_widget_cards.rb | 2 +- ...16105911_add_moderation_flags_to_proposal_notifications.rb | 2 +- db/migrate/20180517141120_add_hidden_at_to_newsletters.rb | 2 +- db/migrate/20180519132610_create_widget_feeds.rb | 2 +- ...20180604124515_add_recommended_debates_setting_to_users.rb | 2 +- ...180604151014_add_recommended_proposals_setting_to_users.rb | 2 +- .../20180613143922_add_moderation_attrs_to_investments.rb | 2 +- .../20180711224810_enable_recommendations_by_default.rb | 2 +- ...change_budget_investment_statuses_to_milestone_statuses.rb | 2 +- .../20180713124501_make_investment_milestones_polymorphic.rb | 2 +- db/migrate/20180718115545_create_i18n_content_translations.rb | 2 +- db/migrate/20180727140800_add_banner_translations.rb | 2 +- .../20180730120800_add_homepage_content_translations.rb | 2 +- db/migrate/20180730213824_add_poll_translations.rb | 2 +- .../20180731150800_add_admin_notification_translations.rb | 2 +- db/migrate/20180731173147_add_poll_question_translations.rb | 2 +- .../20180801114529_add_poll_question_answer_translations.rb | 2 +- ...180801140800_add_collaborative_legislation_translations.rb | 2 +- .../20180807104331_add_selected_to_legislation_proposals.rb | 2 +- db/migrate/20180813141443_create_ckeditor_assets.rb | 2 +- db/migrate/20180924071722_add_translate_pages.rb | 2 +- ...20181016204729_add_draft_phase_to_legislation_processes.rb | 2 +- .../20181108103111_add_allow_custom_content_to_headings.rb | 2 +- db/migrate/20181108142513_create_heading_content_blocks.rb | 2 +- db/migrate/20181109111037_add_location_to_headings.rb | 2 +- ...d_milestones_summary_to_legislation_process_translation.rb | 2 +- .../20181206153510_add_home_page_to_legislation_processes.rb | 2 +- ...81218164126_add_site_customization_page_to_widget_cards.rb | 4 ++-- ...3447_add_header_color_settings_to_legislation_processes.rb | 4 ++-- db/migrate/20190103132925_create_progress_bars.rb | 2 +- db/migrate/20190104160114_create_active_polls.rb | 2 +- db/migrate/20190104170114_add_active_polls_translations.rb | 2 +- ...8115237_add_cached_votes_score_to_legislation_proposals.rb | 2 +- db/migrate/20190118135741_add_budget_translations.rb | 2 +- db/migrate/20190119160418_add_budget_phase_translations.rb | 2 +- db/migrate/20190120155819_add_budget_group_translations.rb | 2 +- db/migrate/20190121171237_add_budget_heading_translations.rb | 2 +- db/migrate/20190124084612_drop_annotations_table.rb | 2 +- db/migrate/20190124085815_drop_legacy_legislations_table.rb | 2 +- db/migrate/20190131122858_add_columns_to_widget_cards.rb | 2 +- db/migrate/20190205131722_increase_tag_name_limit.rb | 2 +- 413 files changed, 422 insertions(+), 422 deletions(-) diff --git a/db/migrate/20150715190041_create_debates.rb b/db/migrate/20150715190041_create_debates.rb index d84b9ed3a..eb3d4dede 100644 --- a/db/migrate/20150715190041_create_debates.rb +++ b/db/migrate/20150715190041_create_debates.rb @@ -1,4 +1,4 @@ -class CreateDebates < ActiveRecord::Migration +class CreateDebates < ActiveRecord::Migration[4.2] def change create_table :debates do |t| t.string :title diff --git a/db/migrate/20150716154501_remove_external_link_from_debates.rb b/db/migrate/20150716154501_remove_external_link_from_debates.rb index 5991b363d..9b59db739 100644 --- a/db/migrate/20150716154501_remove_external_link_from_debates.rb +++ b/db/migrate/20150716154501_remove_external_link_from_debates.rb @@ -1,4 +1,4 @@ -class RemoveExternalLinkFromDebates < ActiveRecord::Migration +class RemoveExternalLinkFromDebates < ActiveRecord::Migration[4.2] def change remove_column :debates, :external_link end diff --git a/db/migrate/20150716174358_devise_create_users.rb b/db/migrate/20150716174358_devise_create_users.rb index c18355f3d..03f8179bb 100644 --- a/db/migrate/20150716174358_devise_create_users.rb +++ b/db/migrate/20150716174358_devise_create_users.rb @@ -1,4 +1,4 @@ -class DeviseCreateUsers < ActiveRecord::Migration +class DeviseCreateUsers < ActiveRecord::Migration[4.2] def change create_table(:users) do |t| ## Database authenticatable diff --git a/db/migrate/20150717164054_add_first_name_and_last_name_to_users.rb b/db/migrate/20150717164054_add_first_name_and_last_name_to_users.rb index 3be763bfd..bd0f98b0d 100644 --- a/db/migrate/20150717164054_add_first_name_and_last_name_to_users.rb +++ b/db/migrate/20150717164054_add_first_name_and_last_name_to_users.rb @@ -1,4 +1,4 @@ -class AddFirstNameAndLastNameToUsers < ActiveRecord::Migration +class AddFirstNameAndLastNameToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :first_name, :string add_column :users, :last_name, :string diff --git a/db/migrate/20150717180105_acts_as_votable_migration.rb b/db/migrate/20150717180105_acts_as_votable_migration.rb index 798dd48f9..2770b4cef 100644 --- a/db/migrate/20150717180105_acts_as_votable_migration.rb +++ b/db/migrate/20150717180105_acts_as_votable_migration.rb @@ -1,4 +1,4 @@ -class ActsAsVotableMigration < ActiveRecord::Migration +class ActsAsVotableMigration < ActiveRecord::Migration[4.2] def self.up create_table :votes do |t| diff --git a/db/migrate/20150718075238_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb b/db/migrate/20150718075238_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb index 2cf5741f8..cdf0ae25b 100644 --- a/db/migrate/20150718075238_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +++ b/db/migrate/20150718075238_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb @@ -1,5 +1,5 @@ # This migration comes from acts_as_taggable_on_engine (originally 1) -class ActsAsTaggableOnMigration < ActiveRecord::Migration +class ActsAsTaggableOnMigration < ActiveRecord::Migration[4.2] def self.up create_table :tags do |t| t.string :name diff --git a/db/migrate/20150718075337_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb b/db/migrate/20150718075337_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb index 6bbd5ab3d..4fd0d989c 100644 --- a/db/migrate/20150718075337_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +++ b/db/migrate/20150718075337_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb @@ -1,5 +1,5 @@ # This migration comes from acts_as_taggable_on_engine (originally 3) -class AddTaggingsCounterCacheToTags < ActiveRecord::Migration +class AddTaggingsCounterCacheToTags < ActiveRecord::Migration[4.2] def self.up add_column :tags, :taggings_count, :integer, default: 0 end diff --git a/db/migrate/20150718091702_acts_as_commentable_with_threading_migration.rb b/db/migrate/20150718091702_acts_as_commentable_with_threading_migration.rb index 977fc79df..2aa7eab6a 100644 --- a/db/migrate/20150718091702_acts_as_commentable_with_threading_migration.rb +++ b/db/migrate/20150718091702_acts_as_commentable_with_threading_migration.rb @@ -1,4 +1,4 @@ -class ActsAsCommentableWithThreadingMigration < ActiveRecord::Migration +class ActsAsCommentableWithThreadingMigration < ActiveRecord::Migration[4.2] def self.up create_table :comments, force: true do |t| t.integer :commentable_id diff --git a/db/migrate/20150731110702_add_confirmable_to_devise_for_users.rb b/db/migrate/20150731110702_add_confirmable_to_devise_for_users.rb index c6b4310e6..048e1d4b1 100644 --- a/db/migrate/20150731110702_add_confirmable_to_devise_for_users.rb +++ b/db/migrate/20150731110702_add_confirmable_to_devise_for_users.rb @@ -1,4 +1,4 @@ -class AddConfirmableToDeviseForUsers < ActiveRecord::Migration +class AddConfirmableToDeviseForUsers < ActiveRecord::Migration[4.2] def change # Confirmable add_column :users, :confirmation_token, :string diff --git a/db/migrate/20150804144230_create_visits.rb b/db/migrate/20150804144230_create_visits.rb index 6f5156c0e..2de0b71ee 100644 --- a/db/migrate/20150804144230_create_visits.rb +++ b/db/migrate/20150804144230_create_visits.rb @@ -1,4 +1,4 @@ -class CreateVisits < ActiveRecord::Migration +class CreateVisits < ActiveRecord::Migration[4.2] def change create_table :visits, id: false do |t| t.uuid :id, default: nil, primary_key: true diff --git a/db/migrate/20150804144231_create_ahoy_events.rb b/db/migrate/20150804144231_create_ahoy_events.rb index 81fb71f37..2b9f5931c 100644 --- a/db/migrate/20150804144231_create_ahoy_events.rb +++ b/db/migrate/20150804144231_create_ahoy_events.rb @@ -1,4 +1,4 @@ -class CreateAhoyEvents < ActiveRecord::Migration +class CreateAhoyEvents < ActiveRecord::Migration[4.2] def change create_table :ahoy_events, id: false do |t| t.uuid :id, default: nil, primary_key: true diff --git a/db/migrate/20150806111435_change_debates_title_length.rb b/db/migrate/20150806111435_change_debates_title_length.rb index 7c170bc15..bbf50b4ed 100644 --- a/db/migrate/20150806111435_change_debates_title_length.rb +++ b/db/migrate/20150806111435_change_debates_title_length.rb @@ -1,4 +1,4 @@ -class ChangeDebatesTitleLength < ActiveRecord::Migration +class ChangeDebatesTitleLength < ActiveRecord::Migration[4.2] def change change_column :debates, :title, :string, limit: 80 end diff --git a/db/migrate/20150806135245_add_nickname_to_user.rb b/db/migrate/20150806135245_add_nickname_to_user.rb index 06bf046f9..4e33ff63c 100644 --- a/db/migrate/20150806135245_add_nickname_to_user.rb +++ b/db/migrate/20150806135245_add_nickname_to_user.rb @@ -1,4 +1,4 @@ -class AddNicknameToUser < ActiveRecord::Migration +class AddNicknameToUser < ActiveRecord::Migration[4.2] def change add_column :users, :nickname, :string end diff --git a/db/migrate/20150806140048_add_use_nickname_to_users.rb b/db/migrate/20150806140048_add_use_nickname_to_users.rb index 032a791cd..1c0dfa18c 100644 --- a/db/migrate/20150806140048_add_use_nickname_to_users.rb +++ b/db/migrate/20150806140048_add_use_nickname_to_users.rb @@ -1,4 +1,4 @@ -class AddUseNicknameToUsers < ActiveRecord::Migration +class AddUseNicknameToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :use_nickname, :boolean, null: false, default: false end diff --git a/db/migrate/20150806163142_add_preferences_to_users.rb b/db/migrate/20150806163142_add_preferences_to_users.rb index 8c3ae57cc..cd72264ab 100644 --- a/db/migrate/20150806163142_add_preferences_to_users.rb +++ b/db/migrate/20150806163142_add_preferences_to_users.rb @@ -1,4 +1,4 @@ -class AddPreferencesToUsers < ActiveRecord::Migration +class AddPreferencesToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :email_on_debate_comment, :boolean, default: false add_column :users, :email_on_comment_reply, :boolean, default: false diff --git a/db/migrate/20150807140235_create_administrators.rb b/db/migrate/20150807140235_create_administrators.rb index d844531a4..d4f9342fa 100644 --- a/db/migrate/20150807140235_create_administrators.rb +++ b/db/migrate/20150807140235_create_administrators.rb @@ -1,4 +1,4 @@ -class CreateAdministrators < ActiveRecord::Migration +class CreateAdministrators < ActiveRecord::Migration[4.2] def change create_table :administrators do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/db/migrate/20150807140346_create_moderators.rb b/db/migrate/20150807140346_create_moderators.rb index 526a29944..103011395 100644 --- a/db/migrate/20150807140346_create_moderators.rb +++ b/db/migrate/20150807140346_create_moderators.rb @@ -1,4 +1,4 @@ -class CreateModerators < ActiveRecord::Migration +class CreateModerators < ActiveRecord::Migration[4.2] def change create_table :moderators do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/db/migrate/20150808100936_add_ip_to_ahoy_event.rb b/db/migrate/20150808100936_add_ip_to_ahoy_event.rb index 2c6d9d9b2..1e1500d07 100644 --- a/db/migrate/20150808100936_add_ip_to_ahoy_event.rb +++ b/db/migrate/20150808100936_add_ip_to_ahoy_event.rb @@ -1,4 +1,4 @@ -class AddIpToAhoyEvent < ActiveRecord::Migration +class AddIpToAhoyEvent < ActiveRecord::Migration[4.2] def change add_column :ahoy_events, :ip, :string end diff --git a/db/migrate/20150808102442_add_visit_id_to_debate.rb b/db/migrate/20150808102442_add_visit_id_to_debate.rb index 4d09f2cd0..469a5b41f 100644 --- a/db/migrate/20150808102442_add_visit_id_to_debate.rb +++ b/db/migrate/20150808102442_add_visit_id_to_debate.rb @@ -1,4 +1,4 @@ -class AddVisitIdToDebate < ActiveRecord::Migration +class AddVisitIdToDebate < ActiveRecord::Migration[4.2] def change add_column :debates, :visit_id, :string end diff --git a/db/migrate/20150808141306_create_simple_captcha_data.rb b/db/migrate/20150808141306_create_simple_captcha_data.rb index d636631f0..dae8a3543 100644 --- a/db/migrate/20150808141306_create_simple_captcha_data.rb +++ b/db/migrate/20150808141306_create_simple_captcha_data.rb @@ -1,4 +1,4 @@ -class CreateSimpleCaptchaData < ActiveRecord::Migration +class CreateSimpleCaptchaData < ActiveRecord::Migration[4.2] def self.up create_table :simple_captcha_data do |t| t.string :key, limit: 40 diff --git a/db/migrate/20150810201448_add_hidden_at_to_comments.rb b/db/migrate/20150810201448_add_hidden_at_to_comments.rb index 55d652087..d777f4b31 100644 --- a/db/migrate/20150810201448_add_hidden_at_to_comments.rb +++ b/db/migrate/20150810201448_add_hidden_at_to_comments.rb @@ -1,4 +1,4 @@ -class AddHiddenAtToComments < ActiveRecord::Migration +class AddHiddenAtToComments < ActiveRecord::Migration[4.2] def change add_column :comments, :hidden_at, :datetime add_index :comments, :hidden_at diff --git a/db/migrate/20150811145628_add_hidden_at_to_debates.rb b/db/migrate/20150811145628_add_hidden_at_to_debates.rb index 5fbb29532..bf44db62b 100644 --- a/db/migrate/20150811145628_add_hidden_at_to_debates.rb +++ b/db/migrate/20150811145628_add_hidden_at_to_debates.rb @@ -1,4 +1,4 @@ -class AddHiddenAtToDebates < ActiveRecord::Migration +class AddHiddenAtToDebates < ActiveRecord::Migration[4.2] def change add_column :debates, :hidden_at, :datetime add_index :debates, :hidden_at diff --git a/db/migrate/20150811161459_add_children_count_to_comments.rb b/db/migrate/20150811161459_add_children_count_to_comments.rb index ce233542d..c17589f05 100644 --- a/db/migrate/20150811161459_add_children_count_to_comments.rb +++ b/db/migrate/20150811161459_add_children_count_to_comments.rb @@ -1,4 +1,4 @@ -class AddChildrenCountToComments < ActiveRecord::Migration +class AddChildrenCountToComments < ActiveRecord::Migration[4.2] def up add_column :comments, :children_count, :integer, default: 0 end diff --git a/db/migrate/20150813142213_create_organizations.rb b/db/migrate/20150813142213_create_organizations.rb index a0974df7f..df35bea3a 100644 --- a/db/migrate/20150813142213_create_organizations.rb +++ b/db/migrate/20150813142213_create_organizations.rb @@ -1,4 +1,4 @@ -class CreateOrganizations < ActiveRecord::Migration +class CreateOrganizations < ActiveRecord::Migration[4.2] def change create_table :organizations do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/db/migrate/20150813161654_add_phone_number_to_users.rb b/db/migrate/20150813161654_add_phone_number_to_users.rb index 070b99586..7980ecec9 100644 --- a/db/migrate/20150813161654_add_phone_number_to_users.rb +++ b/db/migrate/20150813161654_add_phone_number_to_users.rb @@ -1,4 +1,4 @@ -class AddPhoneNumberToUsers < ActiveRecord::Migration +class AddPhoneNumberToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :phone_number, :string, limit: 30 end diff --git a/db/migrate/20150814074250_add_official_position_to_user.rb b/db/migrate/20150814074250_add_official_position_to_user.rb index 49719f510..c170de20b 100644 --- a/db/migrate/20150814074250_add_official_position_to_user.rb +++ b/db/migrate/20150814074250_add_official_position_to_user.rb @@ -1,4 +1,4 @@ -class AddOfficialPositionToUser < ActiveRecord::Migration +class AddOfficialPositionToUser < ActiveRecord::Migration[4.2] def change add_column :users, :official_position, :string add_column :users, :official_level, :integer, default: 0 diff --git a/db/migrate/20150815154430_add_featured_to_tags.rb b/db/migrate/20150815154430_add_featured_to_tags.rb index 6ad4d5658..183b80554 100644 --- a/db/migrate/20150815154430_add_featured_to_tags.rb +++ b/db/migrate/20150815154430_add_featured_to_tags.rb @@ -1,4 +1,4 @@ -class AddFeaturedToTags < ActiveRecord::Migration +class AddFeaturedToTags < ActiveRecord::Migration[4.2] def change add_column :tags, :featured, :boolean, default: false end diff --git a/db/migrate/20150817150457_add_settings.rb b/db/migrate/20150817150457_add_settings.rb index 1ba7fe9c6..1e7a35419 100644 --- a/db/migrate/20150817150457_add_settings.rb +++ b/db/migrate/20150817150457_add_settings.rb @@ -1,4 +1,4 @@ -class AddSettings < ActiveRecord::Migration +class AddSettings < ActiveRecord::Migration[4.2] def change create_table :settings do |t| t.string :key diff --git a/db/migrate/20150819135933_add_hidden_at_to_users.rb b/db/migrate/20150819135933_add_hidden_at_to_users.rb index fa54e00e1..265e31dee 100644 --- a/db/migrate/20150819135933_add_hidden_at_to_users.rb +++ b/db/migrate/20150819135933_add_hidden_at_to_users.rb @@ -1,4 +1,4 @@ -class AddHiddenAtToUsers < ActiveRecord::Migration +class AddHiddenAtToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :hidden_at, :datetime add_index :users, :hidden_at diff --git a/db/migrate/20150819193457_add_sms_verification_code_to_users.rb b/db/migrate/20150819193457_add_sms_verification_code_to_users.rb index d886a5ad6..516b38c58 100644 --- a/db/migrate/20150819193457_add_sms_verification_code_to_users.rb +++ b/db/migrate/20150819193457_add_sms_verification_code_to_users.rb @@ -1,4 +1,4 @@ -class AddSmsVerificationCodeToUsers < ActiveRecord::Migration +class AddSmsVerificationCodeToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :sms_verification_code, :string add_column :users, :sms_verified_at, :datetime diff --git a/db/migrate/20150819203410_add_phone_to_users.rb b/db/migrate/20150819203410_add_phone_to_users.rb index 7f94bae93..63d9a9cda 100644 --- a/db/migrate/20150819203410_add_phone_to_users.rb +++ b/db/migrate/20150819203410_add_phone_to_users.rb @@ -1,4 +1,4 @@ -class AddPhoneToUsers < ActiveRecord::Migration +class AddPhoneToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :phone, :string end diff --git a/db/migrate/20150820103351_create_inappropiate_flags.rb b/db/migrate/20150820103351_create_inappropiate_flags.rb index 45bb5cba8..3e69fd15c 100644 --- a/db/migrate/20150820103351_create_inappropiate_flags.rb +++ b/db/migrate/20150820103351_create_inappropiate_flags.rb @@ -1,4 +1,4 @@ -class CreateInappropiateFlags < ActiveRecord::Migration +class CreateInappropiateFlags < ActiveRecord::Migration[4.2] def change create_table :inappropiate_flags do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/db/migrate/20150820103800_add_inappropiate_flag_fields_to_comments.rb b/db/migrate/20150820103800_add_inappropiate_flag_fields_to_comments.rb index 92a53581b..410f6f20f 100644 --- a/db/migrate/20150820103800_add_inappropiate_flag_fields_to_comments.rb +++ b/db/migrate/20150820103800_add_inappropiate_flag_fields_to_comments.rb @@ -1,4 +1,4 @@ -class AddInappropiateFlagFieldsToComments < ActiveRecord::Migration +class AddInappropiateFlagFieldsToComments < ActiveRecord::Migration[4.2] def change add_column :comments, :flagged_as_inappropiate_at, :datetime add_column :comments, :inappropiate_flags_count, :integer, default: 0 diff --git a/db/migrate/20150820104552_add_inappropiate_flag_fields_to_debates.rb b/db/migrate/20150820104552_add_inappropiate_flag_fields_to_debates.rb index c5376ed62..d5c90520b 100644 --- a/db/migrate/20150820104552_add_inappropiate_flag_fields_to_debates.rb +++ b/db/migrate/20150820104552_add_inappropiate_flag_fields_to_debates.rb @@ -1,4 +1,4 @@ -class AddInappropiateFlagFieldsToDebates < ActiveRecord::Migration +class AddInappropiateFlagFieldsToDebates < ActiveRecord::Migration[4.2] def change add_column :debates, :flagged_as_inappropiate_at, :datetime add_column :debates, :inappropiate_flags_count, :integer, default: 0 diff --git a/db/migrate/20150821130019_changes_user_registrations_fields.rb b/db/migrate/20150821130019_changes_user_registrations_fields.rb index 600762324..61ca5c5bf 100644 --- a/db/migrate/20150821130019_changes_user_registrations_fields.rb +++ b/db/migrate/20150821130019_changes_user_registrations_fields.rb @@ -1,4 +1,4 @@ -class ChangesUserRegistrationsFields < ActiveRecord::Migration +class ChangesUserRegistrationsFields < ActiveRecord::Migration[4.2] def change add_column :users, :username, :string diff --git a/db/migrate/20150821180131_add_reviewed_at_to_comments.rb b/db/migrate/20150821180131_add_reviewed_at_to_comments.rb index b854002ac..7dcff0802 100644 --- a/db/migrate/20150821180131_add_reviewed_at_to_comments.rb +++ b/db/migrate/20150821180131_add_reviewed_at_to_comments.rb @@ -1,4 +1,4 @@ -class AddReviewedAtToComments < ActiveRecord::Migration +class AddReviewedAtToComments < ActiveRecord::Migration[4.2] def change add_column :comments, :reviewed_at, :datetime end diff --git a/db/migrate/20150821180155_add_reviewed_at_to_debates.rb b/db/migrate/20150821180155_add_reviewed_at_to_debates.rb index c02ed3e3b..7945717a6 100644 --- a/db/migrate/20150821180155_add_reviewed_at_to_debates.rb +++ b/db/migrate/20150821180155_add_reviewed_at_to_debates.rb @@ -1,4 +1,4 @@ -class AddReviewedAtToDebates < ActiveRecord::Migration +class AddReviewedAtToDebates < ActiveRecord::Migration[4.2] def change add_column :debates, :reviewed_at, :datetime end diff --git a/db/migrate/20150822095305_create_verified_users.rb b/db/migrate/20150822095305_create_verified_users.rb index 457ba6b89..1f23e0b5b 100644 --- a/db/migrate/20150822095305_create_verified_users.rb +++ b/db/migrate/20150822095305_create_verified_users.rb @@ -1,4 +1,4 @@ -class CreateVerifiedUsers < ActiveRecord::Migration +class CreateVerifiedUsers < ActiveRecord::Migration[4.2] def change unless ActiveRecord::Base.connection.data_source_exists?("verified_users") create_table :verified_users do |t| diff --git a/db/migrate/20150822100557_add_document_to_users.rb b/db/migrate/20150822100557_add_document_to_users.rb index 48259c417..45c5df8e7 100644 --- a/db/migrate/20150822100557_add_document_to_users.rb +++ b/db/migrate/20150822100557_add_document_to_users.rb @@ -1,4 +1,4 @@ -class AddDocumentToUsers < ActiveRecord::Migration +class AddDocumentToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :document_number, :string add_column :users, :document_type, :string diff --git a/db/migrate/20150822132547_add_residence_verified_at_to_users.rb b/db/migrate/20150822132547_add_residence_verified_at_to_users.rb index 65750fe82..4c5dc2f6d 100644 --- a/db/migrate/20150822132547_add_residence_verified_at_to_users.rb +++ b/db/migrate/20150822132547_add_residence_verified_at_to_users.rb @@ -1,4 +1,4 @@ -class AddResidenceVerifiedAtToUsers < ActiveRecord::Migration +class AddResidenceVerifiedAtToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :residence_verified_at, :datetime end diff --git a/db/migrate/20150823111403_add_letter_to_users.rb b/db/migrate/20150823111403_add_letter_to_users.rb index bdb7c8684..0423ba959 100644 --- a/db/migrate/20150823111403_add_letter_to_users.rb +++ b/db/migrate/20150823111403_add_letter_to_users.rb @@ -1,4 +1,4 @@ -class AddLetterToUsers < ActiveRecord::Migration +class AddLetterToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :letter_requested, :boolean, default: false add_column :users, :letter_sent_at, :datetime diff --git a/db/migrate/20150823114519_add_email_verified_at_to_users.rb b/db/migrate/20150823114519_add_email_verified_at_to_users.rb index 69a6b6ec1..97071989e 100644 --- a/db/migrate/20150823114519_add_email_verified_at_to_users.rb +++ b/db/migrate/20150823114519_add_email_verified_at_to_users.rb @@ -1,4 +1,4 @@ -class AddEmailVerifiedAtToUsers < ActiveRecord::Migration +class AddEmailVerifiedAtToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :email_verified_at, :datetime end diff --git a/db/migrate/20150823121109_add_email_verification_to_users.rb b/db/migrate/20150823121109_add_email_verification_to_users.rb index 4342cc174..a0990a49b 100644 --- a/db/migrate/20150823121109_add_email_verification_to_users.rb +++ b/db/migrate/20150823121109_add_email_verification_to_users.rb @@ -1,4 +1,4 @@ -class AddEmailVerificationToUsers < ActiveRecord::Migration +class AddEmailVerificationToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :email_verification_token, :string add_column :users, :email_for_verification, :string diff --git a/db/migrate/20150824110104_add_verified_user_sms_verified_at_to_users.rb b/db/migrate/20150824110104_add_verified_user_sms_verified_at_to_users.rb index 06d8f47d0..86da8989b 100644 --- a/db/migrate/20150824110104_add_verified_user_sms_verified_at_to_users.rb +++ b/db/migrate/20150824110104_add_verified_user_sms_verified_at_to_users.rb @@ -1,4 +1,4 @@ -class AddVerifiedUserSmsVerifiedAtToUsers < ActiveRecord::Migration +class AddVerifiedUserSmsVerifiedAtToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :verified_user_sms_verified_at, :datetime end diff --git a/db/migrate/20150824111844_add_moderator_id_to_comment.rb b/db/migrate/20150824111844_add_moderator_id_to_comment.rb index 014c3ecf3..7e46415cf 100644 --- a/db/migrate/20150824111844_add_moderator_id_to_comment.rb +++ b/db/migrate/20150824111844_add_moderator_id_to_comment.rb @@ -1,4 +1,4 @@ -class AddModeratorIdToComment < ActiveRecord::Migration +class AddModeratorIdToComment < ActiveRecord::Migration[4.2] def change add_column :comments, :moderator_id, :integer, default: nil end diff --git a/db/migrate/20150824113326_add_administrator_id_to_comment.rb b/db/migrate/20150824113326_add_administrator_id_to_comment.rb index 7be8274cb..943419e0a 100644 --- a/db/migrate/20150824113326_add_administrator_id_to_comment.rb +++ b/db/migrate/20150824113326_add_administrator_id_to_comment.rb @@ -1,4 +1,4 @@ -class AddAdministratorIdToComment < ActiveRecord::Migration +class AddAdministratorIdToComment < ActiveRecord::Migration[4.2] def change add_column :comments, :administrator_id, :integer, default: nil end diff --git a/db/migrate/20150824144524_create_identities.rb b/db/migrate/20150824144524_create_identities.rb index 38a5e603a..57d36e38e 100644 --- a/db/migrate/20150824144524_create_identities.rb +++ b/db/migrate/20150824144524_create_identities.rb @@ -1,4 +1,4 @@ -class CreateIdentities < ActiveRecord::Migration +class CreateIdentities < ActiveRecord::Migration[4.2] def change create_table :identities do |t| t.references :user, index: true, foreign_key: true diff --git a/db/migrate/20150825124821_adds_votable_cache_field_to_comments.rb b/db/migrate/20150825124821_adds_votable_cache_field_to_comments.rb index e2da7e12f..50297aa9c 100644 --- a/db/migrate/20150825124821_adds_votable_cache_field_to_comments.rb +++ b/db/migrate/20150825124821_adds_votable_cache_field_to_comments.rb @@ -1,4 +1,4 @@ -class AddsVotableCacheFieldToComments < ActiveRecord::Migration +class AddsVotableCacheFieldToComments < ActiveRecord::Migration[4.2] def change add_column :comments, :cached_votes_total, :integer, default: 0 add_column :comments, :cached_votes_up, :integer, default: 0 diff --git a/db/migrate/20150825124827_adds_votable_cache_field_to_debates.rb b/db/migrate/20150825124827_adds_votable_cache_field_to_debates.rb index 07df8cf22..834d5310d 100644 --- a/db/migrate/20150825124827_adds_votable_cache_field_to_debates.rb +++ b/db/migrate/20150825124827_adds_votable_cache_field_to_debates.rb @@ -1,4 +1,4 @@ -class AddsVotableCacheFieldToDebates < ActiveRecord::Migration +class AddsVotableCacheFieldToDebates < ActiveRecord::Migration[4.2] def change add_column :debates, :cached_votes_total, :integer, default: 0 add_column :debates, :cached_votes_up, :integer, default: 0 diff --git a/db/migrate/20150825165517_add_sms_tried_to_users.rb b/db/migrate/20150825165517_add_sms_tried_to_users.rb index 280ab5b15..82a55d96d 100644 --- a/db/migrate/20150825165517_add_sms_tried_to_users.rb +++ b/db/migrate/20150825165517_add_sms_tried_to_users.rb @@ -1,4 +1,4 @@ -class AddSmsTriedToUsers < ActiveRecord::Migration +class AddSmsTriedToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :sms_tries, :integer, default: 0 end diff --git a/db/migrate/20150825175647_add_residence_verification_tries_to_users.rb b/db/migrate/20150825175647_add_residence_verification_tries_to_users.rb index fb8a9ed6c..f2fd9492c 100644 --- a/db/migrate/20150825175647_add_residence_verification_tries_to_users.rb +++ b/db/migrate/20150825175647_add_residence_verification_tries_to_users.rb @@ -1,4 +1,4 @@ -class AddResidenceVerificationTriesToUsers < ActiveRecord::Migration +class AddResidenceVerificationTriesToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :residence_verification_tries, :integer, default: 0 end diff --git a/db/migrate/20150825201922_create_addresses.rb b/db/migrate/20150825201922_create_addresses.rb index f3bc11ec2..df23d954e 100644 --- a/db/migrate/20150825201922_create_addresses.rb +++ b/db/migrate/20150825201922_create_addresses.rb @@ -1,4 +1,4 @@ -class CreateAddresses < ActiveRecord::Migration +class CreateAddresses < ActiveRecord::Migration[4.2] def change create_table :addresses do |t| t.integer :user_id diff --git a/db/migrate/20150826112411_rename_reviewed_at_to_archived_at_in_comments_and_debates.rb b/db/migrate/20150826112411_rename_reviewed_at_to_archived_at_in_comments_and_debates.rb index 86bebd8e1..fdbffa843 100644 --- a/db/migrate/20150826112411_rename_reviewed_at_to_archived_at_in_comments_and_debates.rb +++ b/db/migrate/20150826112411_rename_reviewed_at_to_archived_at_in_comments_and_debates.rb @@ -1,4 +1,4 @@ -class RenameReviewedAtToArchivedAtInCommentsAndDebates < ActiveRecord::Migration +class RenameReviewedAtToArchivedAtInCommentsAndDebates < ActiveRecord::Migration[4.2] def change rename_column :comments, :reviewed_at, :archived_at rename_column :debates, :reviewed_at, :archived_at diff --git a/db/migrate/20150826112500_add_comments_count_to_debate.rb b/db/migrate/20150826112500_add_comments_count_to_debate.rb index bf416b669..224a80f5e 100644 --- a/db/migrate/20150826112500_add_comments_count_to_debate.rb +++ b/db/migrate/20150826112500_add_comments_count_to_debate.rb @@ -1,4 +1,4 @@ -class AddCommentsCountToDebate < ActiveRecord::Migration +class AddCommentsCountToDebate < ActiveRecord::Migration[4.2] def change add_column :debates, :comments_count, :integer, default: 0 end diff --git a/db/migrate/20150826182010_refactor_verification_columns.rb b/db/migrate/20150826182010_refactor_verification_columns.rb index 1133d323e..02d7de5e5 100644 --- a/db/migrate/20150826182010_refactor_verification_columns.rb +++ b/db/migrate/20150826182010_refactor_verification_columns.rb @@ -1,4 +1,4 @@ -class RefactorVerificationColumns < ActiveRecord::Migration +class RefactorVerificationColumns < ActiveRecord::Migration[4.2] def change rename_column :users, :sms_verification_code, :sms_confirmation_code diff --git a/db/migrate/20150827080624_rename_inappropiate_flags_as_flags.rb b/db/migrate/20150827080624_rename_inappropiate_flags_as_flags.rb index 26058bde0..3cdcf7f0f 100644 --- a/db/migrate/20150827080624_rename_inappropiate_flags_as_flags.rb +++ b/db/migrate/20150827080624_rename_inappropiate_flags_as_flags.rb @@ -1,4 +1,4 @@ -class RenameInappropiateFlagsAsFlags < ActiveRecord::Migration +class RenameInappropiateFlagsAsFlags < ActiveRecord::Migration[4.2] def change rename_table :inappropiate_flags, :flags end diff --git a/db/migrate/20150827080641_rename_archived_at_to_ignored_flag_at_in_comments_and_debates.rb b/db/migrate/20150827080641_rename_archived_at_to_ignored_flag_at_in_comments_and_debates.rb index 5a0c90085..930554d42 100644 --- a/db/migrate/20150827080641_rename_archived_at_to_ignored_flag_at_in_comments_and_debates.rb +++ b/db/migrate/20150827080641_rename_archived_at_to_ignored_flag_at_in_comments_and_debates.rb @@ -1,4 +1,4 @@ -class RenameArchivedAtToIgnoredFlagAtInCommentsAndDebates < ActiveRecord::Migration +class RenameArchivedAtToIgnoredFlagAtInCommentsAndDebates < ActiveRecord::Migration[4.2] def change rename_column :comments, :archived_at, :ignored_flag_at rename_column :debates, :archived_at, :ignored_flag_at diff --git a/db/migrate/20150827080701_add_confirmed_hide_at_to_comments_and_debates.rb b/db/migrate/20150827080701_add_confirmed_hide_at_to_comments_and_debates.rb index 20d2872ac..91306a9ca 100644 --- a/db/migrate/20150827080701_add_confirmed_hide_at_to_comments_and_debates.rb +++ b/db/migrate/20150827080701_add_confirmed_hide_at_to_comments_and_debates.rb @@ -1,4 +1,4 @@ -class AddConfirmedHideAtToCommentsAndDebates < ActiveRecord::Migration +class AddConfirmedHideAtToCommentsAndDebates < ActiveRecord::Migration[4.2] def change add_column :debates, :confirmed_hide_at, :datetime add_column :comments, :confirmed_hide_at, :datetime diff --git a/db/migrate/20150827081657_rename_inappropiate_flags_count_to_flags_count_in_debates_and_comments.rb b/db/migrate/20150827081657_rename_inappropiate_flags_count_to_flags_count_in_debates_and_comments.rb index 2f2a9285d..ead77388e 100644 --- a/db/migrate/20150827081657_rename_inappropiate_flags_count_to_flags_count_in_debates_and_comments.rb +++ b/db/migrate/20150827081657_rename_inappropiate_flags_count_to_flags_count_in_debates_and_comments.rb @@ -1,4 +1,4 @@ -class RenameInappropiateFlagsCountToFlagsCountInDebatesAndComments < ActiveRecord::Migration +class RenameInappropiateFlagsCountToFlagsCountInDebatesAndComments < ActiveRecord::Migration[4.2] def change rename_column :debates, :inappropiate_flags_count, :flags_count rename_column :comments, :inappropiate_flags_count, :flags_count diff --git a/db/migrate/20150827083232_remove_flagged_as_inappropiate_at_from_comments_and_debates.rb b/db/migrate/20150827083232_remove_flagged_as_inappropiate_at_from_comments_and_debates.rb index c226ecb3f..e68af1d6c 100644 --- a/db/migrate/20150827083232_remove_flagged_as_inappropiate_at_from_comments_and_debates.rb +++ b/db/migrate/20150827083232_remove_flagged_as_inappropiate_at_from_comments_and_debates.rb @@ -1,4 +1,4 @@ -class RemoveFlaggedAsInappropiateAtFromCommentsAndDebates < ActiveRecord::Migration +class RemoveFlaggedAsInappropiateAtFromCommentsAndDebates < ActiveRecord::Migration[4.2] def change remove_column :debates, :flagged_as_inappropiate_at remove_column :comments, :flagged_as_inappropiate_at diff --git a/db/migrate/20150828085718_add_confirmed_hide_at_to_users.rb b/db/migrate/20150828085718_add_confirmed_hide_at_to_users.rb index ca299aa5e..652e5c05b 100644 --- a/db/migrate/20150828085718_add_confirmed_hide_at_to_users.rb +++ b/db/migrate/20150828085718_add_confirmed_hide_at_to_users.rb @@ -1,4 +1,4 @@ -class AddConfirmedHideAtToUsers < ActiveRecord::Migration +class AddConfirmedHideAtToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :confirmed_hide_at, :datetime end diff --git a/db/migrate/20150830212600_add_cached_anonymous_votes_total_to_debate.rb b/db/migrate/20150830212600_add_cached_anonymous_votes_total_to_debate.rb index 196d5b517..0b8d260b9 100644 --- a/db/migrate/20150830212600_add_cached_anonymous_votes_total_to_debate.rb +++ b/db/migrate/20150830212600_add_cached_anonymous_votes_total_to_debate.rb @@ -1,4 +1,4 @@ -class AddCachedAnonymousVotesTotalToDebate < ActiveRecord::Migration +class AddCachedAnonymousVotesTotalToDebate < ActiveRecord::Migration[4.2] def change add_column :debates, :cached_anonymous_votes_total, :integer, default: 0 end diff --git a/db/migrate/20150902114558_add_ancestry_to_comments.rb b/db/migrate/20150902114558_add_ancestry_to_comments.rb index 7037c7e68..611be55d7 100644 --- a/db/migrate/20150902114558_add_ancestry_to_comments.rb +++ b/db/migrate/20150902114558_add_ancestry_to_comments.rb @@ -1,4 +1,4 @@ -class AddAncestryToComments < ActiveRecord::Migration +class AddAncestryToComments < ActiveRecord::Migration[4.2] def change add_column :comments, :ancestry, :string diff --git a/db/migrate/20150902120006_remove_parent_id_from_comments.rb b/db/migrate/20150902120006_remove_parent_id_from_comments.rb index 219196533..e8fd4b38d 100644 --- a/db/migrate/20150902120006_remove_parent_id_from_comments.rb +++ b/db/migrate/20150902120006_remove_parent_id_from_comments.rb @@ -1,4 +1,4 @@ -class RemoveParentIdFromComments < ActiveRecord::Migration +class RemoveParentIdFromComments < ActiveRecord::Migration[4.2] def change Comment.build_ancestry_from_parent_ids! rescue nil diff --git a/db/migrate/20150902191315_add_letter_verification_code_to_users.rb b/db/migrate/20150902191315_add_letter_verification_code_to_users.rb index 83142122e..f9fe72261 100644 --- a/db/migrate/20150902191315_add_letter_verification_code_to_users.rb +++ b/db/migrate/20150902191315_add_letter_verification_code_to_users.rb @@ -1,4 +1,4 @@ -class AddLetterVerificationCodeToUsers < ActiveRecord::Migration +class AddLetterVerificationCodeToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :letter_verification_code, :string end diff --git a/db/migrate/20150903142924_remove_children_count_from_comments.rb b/db/migrate/20150903142924_remove_children_count_from_comments.rb index 6e4937335..3a74cd0d5 100644 --- a/db/migrate/20150903142924_remove_children_count_from_comments.rb +++ b/db/migrate/20150903142924_remove_children_count_from_comments.rb @@ -1,4 +1,4 @@ -class RemoveChildrenCountFromComments < ActiveRecord::Migration +class RemoveChildrenCountFromComments < ActiveRecord::Migration[4.2] def change remove_column :comments, :children_count, :integer, default: 0 end diff --git a/db/migrate/20150903155146_add_cached_votes_score_to_debate.rb b/db/migrate/20150903155146_add_cached_votes_score_to_debate.rb index 093b13671..30c78b94c 100644 --- a/db/migrate/20150903155146_add_cached_votes_score_to_debate.rb +++ b/db/migrate/20150903155146_add_cached_votes_score_to_debate.rb @@ -1,4 +1,4 @@ -class AddCachedVotesScoreToDebate < ActiveRecord::Migration +class AddCachedVotesScoreToDebate < ActiveRecord::Migration[4.2] def change add_column :debates, :cached_votes_score, :integer, default: 0 diff --git a/db/migrate/20150903171309_add_hot_score_to_debates.rb b/db/migrate/20150903171309_add_hot_score_to_debates.rb index 7e82d4c13..22330a0bf 100644 --- a/db/migrate/20150903171309_add_hot_score_to_debates.rb +++ b/db/migrate/20150903171309_add_hot_score_to_debates.rb @@ -1,4 +1,4 @@ -class AddHotScoreToDebates < ActiveRecord::Migration +class AddHotScoreToDebates < ActiveRecord::Migration[4.2] def change add_column :debates, :hot_score, :bigint, default: 0 end diff --git a/db/migrate/20150903200440_create_delayed_jobs.rb b/db/migrate/20150903200440_create_delayed_jobs.rb index 27fdcf6cc..f90bc1bc1 100644 --- a/db/migrate/20150903200440_create_delayed_jobs.rb +++ b/db/migrate/20150903200440_create_delayed_jobs.rb @@ -1,4 +1,4 @@ -class CreateDelayedJobs < ActiveRecord::Migration +class CreateDelayedJobs < ActiveRecord::Migration[4.2] def self.up create_table :delayed_jobs, force: true do |table| table.integer :priority, default: 0, null: false # Allows some jobs to jump to the front of the queue diff --git a/db/migrate/20150907064631_add_hot_score_index_to_debates.rb b/db/migrate/20150907064631_add_hot_score_index_to_debates.rb index cbb33785b..ac5054889 100644 --- a/db/migrate/20150907064631_add_hot_score_index_to_debates.rb +++ b/db/migrate/20150907064631_add_hot_score_index_to_debates.rb @@ -1,4 +1,4 @@ -class AddHotScoreIndexToDebates < ActiveRecord::Migration +class AddHotScoreIndexToDebates < ActiveRecord::Migration[4.2] def change add_index(:debates, :hot_score) end diff --git a/db/migrate/20150908102936_add_confidence_score_to_debates.rb b/db/migrate/20150908102936_add_confidence_score_to_debates.rb index b0494a839..ac30fa72a 100644 --- a/db/migrate/20150908102936_add_confidence_score_to_debates.rb +++ b/db/migrate/20150908102936_add_confidence_score_to_debates.rb @@ -1,4 +1,4 @@ -class AddConfidenceScoreToDebates < ActiveRecord::Migration +class AddConfidenceScoreToDebates < ActiveRecord::Migration[4.2] def change add_column :debates, :confidence_score, :integer, default: 0 add_index :debates, :confidence_score diff --git a/db/migrate/20150909131133_set_username_limit.rb b/db/migrate/20150909131133_set_username_limit.rb index 4ef71693a..a9e60e1da 100644 --- a/db/migrate/20150909131133_set_username_limit.rb +++ b/db/migrate/20150909131133_set_username_limit.rb @@ -1,4 +1,4 @@ -class SetUsernameLimit < ActiveRecord::Migration +class SetUsernameLimit < ActiveRecord::Migration[4.2] def up execute "ALTER TABLE users ALTER COLUMN username TYPE VARCHAR(60) USING SUBSTR(username, 1, 60)" change_column :users, :username, :string, limit: 60 diff --git a/db/migrate/20150909135032_remove_comment_title.rb b/db/migrate/20150909135032_remove_comment_title.rb index daf224871..4e151bc70 100644 --- a/db/migrate/20150909135032_remove_comment_title.rb +++ b/db/migrate/20150909135032_remove_comment_title.rb @@ -1,4 +1,4 @@ -class RemoveCommentTitle < ActiveRecord::Migration +class RemoveCommentTitle < ActiveRecord::Migration[4.2] def change remove_column :comments, :title, :string end diff --git a/db/migrate/20150909142534_set_organization_name_limit.rb b/db/migrate/20150909142534_set_organization_name_limit.rb index 55ce2aa62..a90f82ac3 100644 --- a/db/migrate/20150909142534_set_organization_name_limit.rb +++ b/db/migrate/20150909142534_set_organization_name_limit.rb @@ -1,4 +1,4 @@ -class SetOrganizationNameLimit < ActiveRecord::Migration +class SetOrganizationNameLimit < ActiveRecord::Migration[4.2] def up execute "ALTER TABLE organizations ALTER COLUMN name TYPE VARCHAR(60) USING SUBSTR(name, 1, 60)" change_column :organizations, :name, :string, limit: 60 diff --git a/db/migrate/20150909153455_set_tag_name_limit.rb b/db/migrate/20150909153455_set_tag_name_limit.rb index f43dfe3e5..471392bee 100644 --- a/db/migrate/20150909153455_set_tag_name_limit.rb +++ b/db/migrate/20150909153455_set_tag_name_limit.rb @@ -1,4 +1,4 @@ -class SetTagNameLimit < ActiveRecord::Migration +class SetTagNameLimit < ActiveRecord::Migration[4.2] def up execute "ALTER TABLE tags ALTER COLUMN name TYPE VARCHAR(40) USING SUBSTR(name, 1, 40)" change_column :tags, :name, :string, limit: 40 diff --git a/db/migrate/20150909211203_create_failed_census_calls.rb b/db/migrate/20150909211203_create_failed_census_calls.rb index 0850f68ea..c00a38441 100644 --- a/db/migrate/20150909211203_create_failed_census_calls.rb +++ b/db/migrate/20150909211203_create_failed_census_calls.rb @@ -1,4 +1,4 @@ -class CreateFailedCensusCalls < ActiveRecord::Migration +class CreateFailedCensusCalls < ActiveRecord::Migration[4.2] def change create_table :failed_census_calls do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/db/migrate/20150910092713_add_letter_verification_tries_to_users.rb b/db/migrate/20150910092713_add_letter_verification_tries_to_users.rb index 622ce6b2d..92efffb63 100644 --- a/db/migrate/20150910092713_add_letter_verification_tries_to_users.rb +++ b/db/migrate/20150910092713_add_letter_verification_tries_to_users.rb @@ -1,4 +1,4 @@ -class AddLetterVerificationTriesToUsers < ActiveRecord::Migration +class AddLetterVerificationTriesToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :letter_verification_tries, :integer, default: 0 end diff --git a/db/migrate/20150910133047_create_locks.rb b/db/migrate/20150910133047_create_locks.rb index 03611d97a..ae349b9ec 100644 --- a/db/migrate/20150910133047_create_locks.rb +++ b/db/migrate/20150910133047_create_locks.rb @@ -1,4 +1,4 @@ -class CreateLocks < ActiveRecord::Migration +class CreateLocks < ActiveRecord::Migration[4.2] def change create_table :locks do |t| t.references :user, index: true, foreign_key: true diff --git a/db/migrate/20150910152734_remove_verification_tries_from_users.rb b/db/migrate/20150910152734_remove_verification_tries_from_users.rb index cffaa971c..53d6ed4b1 100644 --- a/db/migrate/20150910152734_remove_verification_tries_from_users.rb +++ b/db/migrate/20150910152734_remove_verification_tries_from_users.rb @@ -1,4 +1,4 @@ -class RemoveVerificationTriesFromUsers < ActiveRecord::Migration +class RemoveVerificationTriesFromUsers < ActiveRecord::Migration[4.2] def change remove_column :users, :sms_confirmation_tries, :integer, default: 0 remove_column :users, :residence_verification_tries, :integer, default: 0 diff --git a/db/migrate/20150911171301_create_proposal.rb b/db/migrate/20150911171301_create_proposal.rb index 37dd1bb85..79bb58eef 100644 --- a/db/migrate/20150911171301_create_proposal.rb +++ b/db/migrate/20150911171301_create_proposal.rb @@ -1,4 +1,4 @@ -class CreateProposal < ActiveRecord::Migration +class CreateProposal < ActiveRecord::Migration[4.2] def change create_table :proposals do |t| t.string "title", limit: 80 diff --git a/db/migrate/20150912145218_add_responsible_name_to_organizations.rb b/db/migrate/20150912145218_add_responsible_name_to_organizations.rb index 08598e7c4..3a747a703 100644 --- a/db/migrate/20150912145218_add_responsible_name_to_organizations.rb +++ b/db/migrate/20150912145218_add_responsible_name_to_organizations.rb @@ -1,4 +1,4 @@ -class AddResponsibleNameToOrganizations < ActiveRecord::Migration +class AddResponsibleNameToOrganizations < ActiveRecord::Migration[4.2] def up add_column :organizations, :responsible_name, :string, limit: 60 diff --git a/db/migrate/20150914113251_add_responsible_to_proposals.rb b/db/migrate/20150914113251_add_responsible_to_proposals.rb index c565c29df..c5c2b5fa0 100644 --- a/db/migrate/20150914113251_add_responsible_to_proposals.rb +++ b/db/migrate/20150914113251_add_responsible_to_proposals.rb @@ -1,4 +1,4 @@ -class AddResponsibleToProposals < ActiveRecord::Migration +class AddResponsibleToProposals < ActiveRecord::Migration[4.2] def change add_column :proposals, :responsible_name, :string, limit: 60 end diff --git a/db/migrate/20150914114019_change_email_config_field_in_user.rb b/db/migrate/20150914114019_change_email_config_field_in_user.rb index 90c875d60..a3de1a095 100644 --- a/db/migrate/20150914114019_change_email_config_field_in_user.rb +++ b/db/migrate/20150914114019_change_email_config_field_in_user.rb @@ -1,4 +1,4 @@ -class ChangeEmailConfigFieldInUser < ActiveRecord::Migration +class ChangeEmailConfigFieldInUser < ActiveRecord::Migration[4.2] def change rename_column :users, :email_on_debate_comment, :email_on_comment end diff --git a/db/migrate/20150914173834_add_summary_to_proposals.rb b/db/migrate/20150914173834_add_summary_to_proposals.rb index 7ebe2df9c..0d84c2196 100644 --- a/db/migrate/20150914173834_add_summary_to_proposals.rb +++ b/db/migrate/20150914173834_add_summary_to_proposals.rb @@ -1,4 +1,4 @@ -class AddSummaryToProposals < ActiveRecord::Migration +class AddSummaryToProposals < ActiveRecord::Migration[4.2] def change add_column :proposals, :summary, :text, limit: 280 end diff --git a/db/migrate/20150914181921_add_more_indexes_for_ahoy.rb b/db/migrate/20150914181921_add_more_indexes_for_ahoy.rb index 7fa8bedc4..86924a42d 100644 --- a/db/migrate/20150914181921_add_more_indexes_for_ahoy.rb +++ b/db/migrate/20150914181921_add_more_indexes_for_ahoy.rb @@ -1,4 +1,4 @@ -class AddMoreIndexesForAhoy < ActiveRecord::Migration +class AddMoreIndexesForAhoy < ActiveRecord::Migration[4.2] def change add_index :ahoy_events, [:name, :time] add_index :visits, [:started_at] diff --git a/db/migrate/20150914182652_adds_indexes.rb b/db/migrate/20150914182652_adds_indexes.rb index a22d0d16e..1f719a6ef 100644 --- a/db/migrate/20150914182652_adds_indexes.rb +++ b/db/migrate/20150914182652_adds_indexes.rb @@ -1,4 +1,4 @@ -class AddsIndexes < ActiveRecord::Migration +class AddsIndexes < ActiveRecord::Migration[4.2] def change add_index :debates, :author_id add_index :debates, [:author_id, :hidden_at] diff --git a/db/migrate/20150914184018_add_indexes_for_searches.rb b/db/migrate/20150914184018_add_indexes_for_searches.rb index 4a4467bea..252343464 100644 --- a/db/migrate/20150914184018_add_indexes_for_searches.rb +++ b/db/migrate/20150914184018_add_indexes_for_searches.rb @@ -1,4 +1,4 @@ -class AddIndexesForSearches < ActiveRecord::Migration +class AddIndexesForSearches < ActiveRecord::Migration[4.2] def change add_index :debates, :title # add_index :debates, :description diff --git a/db/migrate/20150914191003_add_video_url_to_proposal.rb b/db/migrate/20150914191003_add_video_url_to_proposal.rb index 298038e97..ba4decc36 100644 --- a/db/migrate/20150914191003_add_video_url_to_proposal.rb +++ b/db/migrate/20150914191003_add_video_url_to_proposal.rb @@ -1,4 +1,4 @@ -class AddVideoUrlToProposal < ActiveRecord::Migration +class AddVideoUrlToProposal < ActiveRecord::Migration[4.2] def change add_column :proposals, :video_url, :string end diff --git a/db/migrate/20150917102718_add_extra_counters_to_tags.rb b/db/migrate/20150917102718_add_extra_counters_to_tags.rb index 974784772..dfd1c444a 100644 --- a/db/migrate/20150917102718_add_extra_counters_to_tags.rb +++ b/db/migrate/20150917102718_add_extra_counters_to_tags.rb @@ -1,4 +1,4 @@ -class AddExtraCountersToTags < ActiveRecord::Migration +class AddExtraCountersToTags < ActiveRecord::Migration[4.2] def change add_column :tags, :debates_count, :integer, default: 0 add_column :tags, :proposals_count, :integer, default: 0 diff --git a/db/migrate/20150921095553_create_activities.rb b/db/migrate/20150921095553_create_activities.rb index 3fff14205..03582d459 100644 --- a/db/migrate/20150921095553_create_activities.rb +++ b/db/migrate/20150921095553_create_activities.rb @@ -1,4 +1,4 @@ -class CreateActivities < ActiveRecord::Migration +class CreateActivities < ActiveRecord::Migration[4.2] def change create_table :activities do |t| t.integer :user_id diff --git a/db/migrate/20150924112929_add_failed_census_calls_counter_cache_to_users.rb b/db/migrate/20150924112929_add_failed_census_calls_counter_cache_to_users.rb index e9f82c992..0e1c06e1c 100644 --- a/db/migrate/20150924112929_add_failed_census_calls_counter_cache_to_users.rb +++ b/db/migrate/20150924112929_add_failed_census_calls_counter_cache_to_users.rb @@ -1,4 +1,4 @@ -class AddFailedCensusCallsCounterCacheToUsers < ActiveRecord::Migration +class AddFailedCensusCallsCounterCacheToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :failed_census_calls_count, :integer, default: 0 end diff --git a/db/migrate/20150926113052_drop_addresses_table.rb b/db/migrate/20150926113052_drop_addresses_table.rb index 90d22c41a..58ea8e8b9 100644 --- a/db/migrate/20150926113052_drop_addresses_table.rb +++ b/db/migrate/20150926113052_drop_addresses_table.rb @@ -1,4 +1,4 @@ -class DropAddressesTable < ActiveRecord::Migration +class DropAddressesTable < ActiveRecord::Migration[4.2] def self.up drop_table :addresses end diff --git a/db/migrate/20150926115929_adds_resilient_locked_until_default.rb b/db/migrate/20150926115929_adds_resilient_locked_until_default.rb index 8043110cd..d3fb1f4e5 100644 --- a/db/migrate/20150926115929_adds_resilient_locked_until_default.rb +++ b/db/migrate/20150926115929_adds_resilient_locked_until_default.rb @@ -1,4 +1,4 @@ -class AddsResilientLockedUntilDefault < ActiveRecord::Migration +class AddsResilientLockedUntilDefault < ActiveRecord::Migration[4.2] def up change_column_default :locks, :locked_until, Time.new(2000, 1, 1, 1, 1, 1) diff --git a/db/migrate/20150928115005_create_notifications.rb b/db/migrate/20150928115005_create_notifications.rb index 42bbbf72e..fc2507464 100644 --- a/db/migrate/20150928115005_create_notifications.rb +++ b/db/migrate/20150928115005_create_notifications.rb @@ -1,4 +1,4 @@ -class CreateNotifications < ActiveRecord::Migration +class CreateNotifications < ActiveRecord::Migration[4.2] def change create_table :notifications do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/db/migrate/20150930082311_create_managers.rb b/db/migrate/20150930082311_create_managers.rb index 3a921bf76..bfcdd2a74 100644 --- a/db/migrate/20150930082311_create_managers.rb +++ b/db/migrate/20150930082311_create_managers.rb @@ -1,4 +1,4 @@ -class CreateManagers < ActiveRecord::Migration +class CreateManagers < ActiveRecord::Migration[4.2] def change create_table :managers do |t| t.string :username, null: false diff --git a/db/migrate/20151002144206_add_unconfirmed_document_number_to_user.rb b/db/migrate/20151002144206_add_unconfirmed_document_number_to_user.rb index 7a00acb91..3c3579bbd 100644 --- a/db/migrate/20151002144206_add_unconfirmed_document_number_to_user.rb +++ b/db/migrate/20151002144206_add_unconfirmed_document_number_to_user.rb @@ -1,4 +1,4 @@ -class AddUnconfirmedDocumentNumberToUser < ActiveRecord::Migration +class AddUnconfirmedDocumentNumberToUser < ActiveRecord::Migration[4.2] def change add_column :users, :unconfirmed_document_number, :string end diff --git a/db/migrate/20151013145126_remove_unconfirmed_document_number_from_user.rb b/db/migrate/20151013145126_remove_unconfirmed_document_number_from_user.rb index cabbdbc27..fadcce2a9 100644 --- a/db/migrate/20151013145126_remove_unconfirmed_document_number_from_user.rb +++ b/db/migrate/20151013145126_remove_unconfirmed_document_number_from_user.rb @@ -1,4 +1,4 @@ -class RemoveUnconfirmedDocumentNumberFromUser < ActiveRecord::Migration +class RemoveUnconfirmedDocumentNumberFromUser < ActiveRecord::Migration[4.2] def change remove_column :users, :unconfirmed_document_number, :string end diff --git a/db/migrate/20151013145757_add_level_two_verified_at_to_users.rb b/db/migrate/20151013145757_add_level_two_verified_at_to_users.rb index aa38dd183..b96f1c2d1 100644 --- a/db/migrate/20151013145757_add_level_two_verified_at_to_users.rb +++ b/db/migrate/20151013145757_add_level_two_verified_at_to_users.rb @@ -1,4 +1,4 @@ -class AddLevelTwoVerifiedAtToUsers < ActiveRecord::Migration +class AddLevelTwoVerifiedAtToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :level_two_verified_at, :datetime end diff --git a/db/migrate/20151015135154_destroy_manager.rb b/db/migrate/20151015135154_destroy_manager.rb index 41e16f0e3..aeaeabd1c 100644 --- a/db/migrate/20151015135154_destroy_manager.rb +++ b/db/migrate/20151015135154_destroy_manager.rb @@ -1,4 +1,4 @@ -class DestroyManager < ActiveRecord::Migration +class DestroyManager < ActiveRecord::Migration[4.2] def self.up drop_table :managers end diff --git a/db/migrate/20151016110703_add_erase_reason_to_users.rb b/db/migrate/20151016110703_add_erase_reason_to_users.rb index be88869b5..281987b87 100644 --- a/db/migrate/20151016110703_add_erase_reason_to_users.rb +++ b/db/migrate/20151016110703_add_erase_reason_to_users.rb @@ -1,4 +1,4 @@ -class AddEraseReasonToUsers < ActiveRecord::Migration +class AddEraseReasonToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :erase_reason, :string end diff --git a/db/migrate/20151019133719_remove_user_constraints.rb b/db/migrate/20151019133719_remove_user_constraints.rb index 0f59a3d34..c78bf6660 100644 --- a/db/migrate/20151019133719_remove_user_constraints.rb +++ b/db/migrate/20151019133719_remove_user_constraints.rb @@ -1,4 +1,4 @@ -class RemoveUserConstraints < ActiveRecord::Migration +class RemoveUserConstraints < ActiveRecord::Migration[4.2] def change change_column(:users, :email, :string, null: true, unique: true) end diff --git a/db/migrate/20151020112354_remove_letter_sent_at_from_users.rb b/db/migrate/20151020112354_remove_letter_sent_at_from_users.rb index 0b982dfbb..c3d52fa2b 100644 --- a/db/migrate/20151020112354_remove_letter_sent_at_from_users.rb +++ b/db/migrate/20151020112354_remove_letter_sent_at_from_users.rb @@ -1,4 +1,4 @@ -class RemoveLetterSentAtFromUsers < ActiveRecord::Migration +class RemoveLetterSentAtFromUsers < ActiveRecord::Migration[4.2] def change remove_column :users, :letter_sent_at, :datetime end diff --git a/db/migrate/20151020135111_create_campaigns.rb b/db/migrate/20151020135111_create_campaigns.rb index 192b7d615..943bae8af 100644 --- a/db/migrate/20151020135111_create_campaigns.rb +++ b/db/migrate/20151020135111_create_campaigns.rb @@ -1,4 +1,4 @@ -class CreateCampaigns < ActiveRecord::Migration +class CreateCampaigns < ActiveRecord::Migration[4.2] def change create_table :campaigns do |t| t.string :name diff --git a/db/migrate/20151021113348_add_erased_at_to_users.rb b/db/migrate/20151021113348_add_erased_at_to_users.rb index 9431c3861..52e075081 100644 --- a/db/migrate/20151021113348_add_erased_at_to_users.rb +++ b/db/migrate/20151021113348_add_erased_at_to_users.rb @@ -1,4 +1,4 @@ -class AddErasedAtToUsers < ActiveRecord::Migration +class AddErasedAtToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :erased_at, :datetime end diff --git a/db/migrate/20151028145921_add_confidence_score_to_comments.rb b/db/migrate/20151028145921_add_confidence_score_to_comments.rb index 636b648bb..540eff133 100644 --- a/db/migrate/20151028145921_add_confidence_score_to_comments.rb +++ b/db/migrate/20151028145921_add_confidence_score_to_comments.rb @@ -1,4 +1,4 @@ -class AddConfidenceScoreToComments < ActiveRecord::Migration +class AddConfidenceScoreToComments < ActiveRecord::Migration[4.2] def change add_column :comments, :confidence_score, :integer, index: true end diff --git a/db/migrate/20151028213830_add_unaccent_extension.rb b/db/migrate/20151028213830_add_unaccent_extension.rb index 60fbc1310..07a0ffb7b 100644 --- a/db/migrate/20151028213830_add_unaccent_extension.rb +++ b/db/migrate/20151028213830_add_unaccent_extension.rb @@ -1,4 +1,4 @@ -class AddUnaccentExtension < ActiveRecord::Migration +class AddUnaccentExtension < ActiveRecord::Migration[4.2] def change execute "create extension if not exists unaccent" end diff --git a/db/migrate/20151028221647_add_pg_trgm_extension.rb b/db/migrate/20151028221647_add_pg_trgm_extension.rb index 97443c2c2..4cd532b1f 100644 --- a/db/migrate/20151028221647_add_pg_trgm_extension.rb +++ b/db/migrate/20151028221647_add_pg_trgm_extension.rb @@ -1,4 +1,4 @@ -class AddPgTrgmExtension < ActiveRecord::Migration +class AddPgTrgmExtension < ActiveRecord::Migration[4.2] def change execute "create extension if not exists pg_trgm" end diff --git a/db/migrate/20151030182217_add_physical_votes_to_proposals.rb b/db/migrate/20151030182217_add_physical_votes_to_proposals.rb index 367f09f48..e7b851734 100644 --- a/db/migrate/20151030182217_add_physical_votes_to_proposals.rb +++ b/db/migrate/20151030182217_add_physical_votes_to_proposals.rb @@ -1,4 +1,4 @@ -class AddPhysicalVotesToProposals < ActiveRecord::Migration +class AddPhysicalVotesToProposals < ActiveRecord::Migration[4.2] def change add_column :proposals, :physical_votes, :integer, default: 0 end diff --git a/db/migrate/20151103175139_make_comments_confidence_score_default_to_0.rb b/db/migrate/20151103175139_make_comments_confidence_score_default_to_0.rb index 788601c44..de12b54be 100644 --- a/db/migrate/20151103175139_make_comments_confidence_score_default_to_0.rb +++ b/db/migrate/20151103175139_make_comments_confidence_score_default_to_0.rb @@ -1,4 +1,4 @@ -class MakeCommentsConfidenceScoreDefaultTo0 < ActiveRecord::Migration +class MakeCommentsConfidenceScoreDefaultTo0 < ActiveRecord::Migration[4.2] def change change_column :comments, :confidence_score, :integer, default: 0, null: false, index: true end diff --git a/db/migrate/20151103194329_add_public_activity_to_users.rb b/db/migrate/20151103194329_add_public_activity_to_users.rb index 8feebdff7..b7217aac1 100644 --- a/db/migrate/20151103194329_add_public_activity_to_users.rb +++ b/db/migrate/20151103194329_add_public_activity_to_users.rb @@ -1,4 +1,4 @@ -class AddPublicActivityToUsers < ActiveRecord::Migration +class AddPublicActivityToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :public_activity, :boolean, default: true end diff --git a/db/migrate/20151111202657_adds_tsvector_update_trigger.rb b/db/migrate/20151111202657_adds_tsvector_update_trigger.rb index ed60a259d..17ae75c54 100644 --- a/db/migrate/20151111202657_adds_tsvector_update_trigger.rb +++ b/db/migrate/20151111202657_adds_tsvector_update_trigger.rb @@ -1,4 +1,4 @@ -class AddsTsvectorUpdateTrigger < ActiveRecord::Migration +class AddsTsvectorUpdateTrigger < ActiveRecord::Migration[4.2] def up add_column :proposals, :tsv, :tsvector diff --git a/db/migrate/20151117222604_create_annotations.rb b/db/migrate/20151117222604_create_annotations.rb index a462b4672..b299cc82b 100644 --- a/db/migrate/20151117222604_create_annotations.rb +++ b/db/migrate/20151117222604_create_annotations.rb @@ -1,4 +1,4 @@ -class CreateAnnotations < ActiveRecord::Migration +class CreateAnnotations < ActiveRecord::Migration[4.2] def change create_table :annotations do |t| t.string :quote diff --git a/db/migrate/20151117225104_add_proposals_to_annotations.rb b/db/migrate/20151117225104_add_proposals_to_annotations.rb index a4b54b2b5..1b692bee6 100644 --- a/db/migrate/20151117225104_add_proposals_to_annotations.rb +++ b/db/migrate/20151117225104_add_proposals_to_annotations.rb @@ -1,4 +1,4 @@ -class AddProposalsToAnnotations < ActiveRecord::Migration +class AddProposalsToAnnotations < ActiveRecord::Migration[4.2] def change add_reference :annotations, :proposal, index: true, foreign_key: true end diff --git a/db/migrate/20151118160928_add_user_to_annotations.rb b/db/migrate/20151118160928_add_user_to_annotations.rb index 0594a4bf3..3d2f04b24 100644 --- a/db/migrate/20151118160928_add_user_to_annotations.rb +++ b/db/migrate/20151118160928_add_user_to_annotations.rb @@ -1,4 +1,4 @@ -class AddUserToAnnotations < ActiveRecord::Migration +class AddUserToAnnotations < ActiveRecord::Migration[4.2] def change add_reference :annotations, :user, index: true, foreign_key: true end diff --git a/db/migrate/20151215113827_create_legislations.rb b/db/migrate/20151215113827_create_legislations.rb index 5ea4ff5be..334d63470 100644 --- a/db/migrate/20151215113827_create_legislations.rb +++ b/db/migrate/20151215113827_create_legislations.rb @@ -1,4 +1,4 @@ -class CreateLegislations < ActiveRecord::Migration +class CreateLegislations < ActiveRecord::Migration[4.2] def change create_table :legislations do |t| t.string :title diff --git a/db/migrate/20151215115319_add_legislation_id_to_annotations.rb b/db/migrate/20151215115319_add_legislation_id_to_annotations.rb index fc415f0a8..419ac67ab 100644 --- a/db/migrate/20151215115319_add_legislation_id_to_annotations.rb +++ b/db/migrate/20151215115319_add_legislation_id_to_annotations.rb @@ -1,4 +1,4 @@ -class AddLegislationIdToAnnotations < ActiveRecord::Migration +class AddLegislationIdToAnnotations < ActiveRecord::Migration[4.2] def change remove_reference :annotations, :proposal add_reference :annotations, :legislation, index: true, foreign_key: true diff --git a/db/migrate/20151215165824_add_newsletter_subscription_to_users.rb b/db/migrate/20151215165824_add_newsletter_subscription_to_users.rb index 61e741c27..d7a0bc5e5 100644 --- a/db/migrate/20151215165824_add_newsletter_subscription_to_users.rb +++ b/db/migrate/20151215165824_add_newsletter_subscription_to_users.rb @@ -1,4 +1,4 @@ -class AddNewsletterSubscriptionToUsers < ActiveRecord::Migration +class AddNewsletterSubscriptionToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :newsletter, :boolean, default: false end diff --git a/db/migrate/20151218114205_create_spending_proposals.rb b/db/migrate/20151218114205_create_spending_proposals.rb index 5bcd3aba1..bac09b9c3 100644 --- a/db/migrate/20151218114205_create_spending_proposals.rb +++ b/db/migrate/20151218114205_create_spending_proposals.rb @@ -1,4 +1,4 @@ -class CreateSpendingProposals < ActiveRecord::Migration +class CreateSpendingProposals < ActiveRecord::Migration[4.2] def change create_table :spending_proposals do |t| t.string :title diff --git a/db/migrate/20160104203329_add_spending_proposals_counter_to_tags.rb b/db/migrate/20160104203329_add_spending_proposals_counter_to_tags.rb index 2aade49cb..1384e06be 100644 --- a/db/migrate/20160104203329_add_spending_proposals_counter_to_tags.rb +++ b/db/migrate/20160104203329_add_spending_proposals_counter_to_tags.rb @@ -1,4 +1,4 @@ -class AddSpendingProposalsCounterToTags < ActiveRecord::Migration +class AddSpendingProposalsCounterToTags < ActiveRecord::Migration[4.2] def change add_column :tags, :spending_proposals_count, :integer, default: 0 add_index :tags, :spending_proposals_count diff --git a/db/migrate/20160104203438_add_spending_proposals_indexes.rb b/db/migrate/20160104203438_add_spending_proposals_indexes.rb index 777b0f678..6b348d96f 100644 --- a/db/migrate/20160104203438_add_spending_proposals_indexes.rb +++ b/db/migrate/20160104203438_add_spending_proposals_indexes.rb @@ -1,4 +1,4 @@ -class AddSpendingProposalsIndexes < ActiveRecord::Migration +class AddSpendingProposalsIndexes < ActiveRecord::Migration[4.2] def change add_index :spending_proposals, :author_id end diff --git a/db/migrate/20160105121132_create_geozones.rb b/db/migrate/20160105121132_create_geozones.rb index 3e43339e9..aa74813ec 100644 --- a/db/migrate/20160105121132_create_geozones.rb +++ b/db/migrate/20160105121132_create_geozones.rb @@ -1,4 +1,4 @@ -class CreateGeozones < ActiveRecord::Migration +class CreateGeozones < ActiveRecord::Migration[4.2] def change create_table :geozones do |t| t.string :name diff --git a/db/migrate/20160105170113_merge_activities_and_notifications.rb b/db/migrate/20160105170113_merge_activities_and_notifications.rb index fac5b213d..8bf113ea7 100644 --- a/db/migrate/20160105170113_merge_activities_and_notifications.rb +++ b/db/migrate/20160105170113_merge_activities_and_notifications.rb @@ -1,4 +1,4 @@ -class MergeActivitiesAndNotifications < ActiveRecord::Migration +class MergeActivitiesAndNotifications < ActiveRecord::Migration[4.2] def change change_table :notifications do |t| t.remove :read diff --git a/db/migrate/20160107114749_add_geozone_to_spending_proposal.rb b/db/migrate/20160107114749_add_geozone_to_spending_proposal.rb index 62130fd9b..6ce760fc1 100644 --- a/db/migrate/20160107114749_add_geozone_to_spending_proposal.rb +++ b/db/migrate/20160107114749_add_geozone_to_spending_proposal.rb @@ -1,4 +1,4 @@ -class AddGeozoneToSpendingProposal < ActiveRecord::Migration +class AddGeozoneToSpendingProposal < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :geozone_id, :integer, default: nil add_index :spending_proposals, :geozone_id diff --git a/db/migrate/20160107132059_add_resolution_to_spending_proposals.rb b/db/migrate/20160107132059_add_resolution_to_spending_proposals.rb index 18365a715..d93a0c50f 100644 --- a/db/migrate/20160107132059_add_resolution_to_spending_proposals.rb +++ b/db/migrate/20160107132059_add_resolution_to_spending_proposals.rb @@ -1,4 +1,4 @@ -class AddResolutionToSpendingProposals < ActiveRecord::Migration +class AddResolutionToSpendingProposals < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :resolution, :string, default: nil add_index :spending_proposals, :resolution diff --git a/db/migrate/20160108114750_add_counter_to_notifications.rb b/db/migrate/20160108114750_add_counter_to_notifications.rb index 7cf3c434c..8024b2acf 100644 --- a/db/migrate/20160108114750_add_counter_to_notifications.rb +++ b/db/migrate/20160108114750_add_counter_to_notifications.rb @@ -1,4 +1,4 @@ -class AddCounterToNotifications < ActiveRecord::Migration +class AddCounterToNotifications < ActiveRecord::Migration[4.2] def change add_column :notifications, :counter, :integer, default: 1 end diff --git a/db/migrate/20160108133501_add_notifications_counter_cache_to_user.rb b/db/migrate/20160108133501_add_notifications_counter_cache_to_user.rb index e106df6ae..dbd6f6439 100644 --- a/db/migrate/20160108133501_add_notifications_counter_cache_to_user.rb +++ b/db/migrate/20160108133501_add_notifications_counter_cache_to_user.rb @@ -1,4 +1,4 @@ -class AddNotificationsCounterCacheToUser < ActiveRecord::Migration +class AddNotificationsCounterCacheToUser < ActiveRecord::Migration[4.2] def change add_column :users, :notifications_count, :integer, default: 0 end diff --git a/db/migrate/20160114110933_create_tolk_tables.rb b/db/migrate/20160114110933_create_tolk_tables.rb index d5e6db9d4..b8fc5ab4d 100644 --- a/db/migrate/20160114110933_create_tolk_tables.rb +++ b/db/migrate/20160114110933_create_tolk_tables.rb @@ -1,4 +1,4 @@ -class CreateTolkTables < ActiveRecord::Migration +class CreateTolkTables < ActiveRecord::Migration[4.2] def self.up create_table :tolk_locales do |t| t.string :name @@ -35,4 +35,4 @@ class CreateTolkTables < ActiveRecord::Migration drop_table :tolk_phrases drop_table :tolk_locales end -end \ No newline at end of file +end diff --git a/db/migrate/20160119132601_add_kind_to_tags.rb b/db/migrate/20160119132601_add_kind_to_tags.rb index a4d196517..3e20b9ecb 100644 --- a/db/migrate/20160119132601_add_kind_to_tags.rb +++ b/db/migrate/20160119132601_add_kind_to_tags.rb @@ -1,4 +1,4 @@ -class AddKindToTags < ActiveRecord::Migration +class AddKindToTags < ActiveRecord::Migration[4.2] def change add_column :tags, :kind, :string end diff --git a/db/migrate/20160119164320_add_registering_with_oauth_to_users.rb b/db/migrate/20160119164320_add_registering_with_oauth_to_users.rb index a29d310ba..809acfbac 100644 --- a/db/migrate/20160119164320_add_registering_with_oauth_to_users.rb +++ b/db/migrate/20160119164320_add_registering_with_oauth_to_users.rb @@ -1,4 +1,4 @@ -class AddRegisteringWithOauthToUsers < ActiveRecord::Migration +class AddRegisteringWithOauthToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :registering_with_oauth, :bool, default: false end diff --git a/db/migrate/20160122124847_add_geozone_to_proposals_and_debates.rb b/db/migrate/20160122124847_add_geozone_to_proposals_and_debates.rb index ad2b0cdff..f7ce68bf8 100644 --- a/db/migrate/20160122124847_add_geozone_to_proposals_and_debates.rb +++ b/db/migrate/20160122124847_add_geozone_to_proposals_and_debates.rb @@ -1,4 +1,4 @@ -class AddGeozoneToProposalsAndDebates < ActiveRecord::Migration +class AddGeozoneToProposalsAndDebates < ActiveRecord::Migration[4.2] def change add_column :proposals, :geozone_id, :integer, default: nil add_index :proposals, :geozone_id diff --git a/db/migrate/20160122153329_add_locale_to_users.rb b/db/migrate/20160122153329_add_locale_to_users.rb index 838ef1122..e393cf06a 100644 --- a/db/migrate/20160122153329_add_locale_to_users.rb +++ b/db/migrate/20160122153329_add_locale_to_users.rb @@ -1,4 +1,4 @@ -class AddLocaleToUsers < ActiveRecord::Migration +class AddLocaleToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :locale, :string end diff --git a/db/migrate/20160125100637_add_confirmed_oauth_email_to_user.rb b/db/migrate/20160125100637_add_confirmed_oauth_email_to_user.rb index 660735ab2..6b65de95e 100644 --- a/db/migrate/20160125100637_add_confirmed_oauth_email_to_user.rb +++ b/db/migrate/20160125100637_add_confirmed_oauth_email_to_user.rb @@ -1,4 +1,4 @@ -class AddConfirmedOauthEmailToUser < ActiveRecord::Migration +class AddConfirmedOauthEmailToUser < ActiveRecord::Migration[4.2] def change add_column :users, :confirmed_oauth_email, :string end diff --git a/db/migrate/20160126090634_rename_confirmed_oauth_email_to_oauth_email.rb b/db/migrate/20160126090634_rename_confirmed_oauth_email_to_oauth_email.rb index 3b3f027fe..32a6c11d0 100644 --- a/db/migrate/20160126090634_rename_confirmed_oauth_email_to_oauth_email.rb +++ b/db/migrate/20160126090634_rename_confirmed_oauth_email_to_oauth_email.rb @@ -1,4 +1,4 @@ -class RenameConfirmedOauthEmailToOauthEmail < ActiveRecord::Migration +class RenameConfirmedOauthEmailToOauthEmail < ActiveRecord::Migration[4.2] def change rename_column :users, :confirmed_oauth_email, :oauth_email end diff --git a/db/migrate/20160204134022_add_tsvector_to_debates.rb b/db/migrate/20160204134022_add_tsvector_to_debates.rb index 7b697347c..96dfd5e9c 100644 --- a/db/migrate/20160204134022_add_tsvector_to_debates.rb +++ b/db/migrate/20160204134022_add_tsvector_to_debates.rb @@ -1,4 +1,4 @@ -class AddTsvectorToDebates < ActiveRecord::Migration +class AddTsvectorToDebates < ActiveRecord::Migration[4.2] def up add_column :debates, :tsv, :tsvector @@ -10,4 +10,4 @@ class AddTsvectorToDebates < ActiveRecord::Migration remove_column :debates, :tsv end -end \ No newline at end of file +end diff --git a/db/migrate/20160207205252_add_external_link_to_debates.rb b/db/migrate/20160207205252_add_external_link_to_debates.rb index eaa0608d2..7cac58808 100644 --- a/db/migrate/20160207205252_add_external_link_to_debates.rb +++ b/db/migrate/20160207205252_add_external_link_to_debates.rb @@ -1,5 +1,5 @@ -class AddExternalLinkToDebates < ActiveRecord::Migration +class AddExternalLinkToDebates < ActiveRecord::Migration[4.2] def change add_column :debates, :external_link, :string, limit: 100 end -end \ No newline at end of file +end diff --git a/db/migrate/20160216121051_add_reporting_fields_to_spending_proposal.rb b/db/migrate/20160216121051_add_reporting_fields_to_spending_proposal.rb index c7eb51496..eebe31294 100644 --- a/db/migrate/20160216121051_add_reporting_fields_to_spending_proposal.rb +++ b/db/migrate/20160216121051_add_reporting_fields_to_spending_proposal.rb @@ -1,8 +1,8 @@ -class AddReportingFieldsToSpendingProposal < ActiveRecord::Migration +class AddReportingFieldsToSpendingProposal < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :price, :float add_column :spending_proposals, :legal, :boolean, default: nil add_column :spending_proposals, :feasible, :boolean, default: nil add_column :spending_proposals, :explanation, :text end -end \ No newline at end of file +end diff --git a/db/migrate/20160217101004_create_valuators.rb b/db/migrate/20160217101004_create_valuators.rb index d7c6d659f..9e3d7361a 100644 --- a/db/migrate/20160217101004_create_valuators.rb +++ b/db/migrate/20160217101004_create_valuators.rb @@ -1,4 +1,4 @@ -class CreateValuators < ActiveRecord::Migration +class CreateValuators < ActiveRecord::Migration[4.2] def change create_table :valuators do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/db/migrate/20160218164923_add_geozone_id_to_users.rb b/db/migrate/20160218164923_add_geozone_id_to_users.rb index 162a28653..8d18efb41 100644 --- a/db/migrate/20160218164923_add_geozone_id_to_users.rb +++ b/db/migrate/20160218164923_add_geozone_id_to_users.rb @@ -1,4 +1,4 @@ -class AddGeozoneIdToUsers < ActiveRecord::Migration +class AddGeozoneIdToUsers < ActiveRecord::Migration[4.2] def change add_reference :users, :geozone, index: true, foreign_key: true end diff --git a/db/migrate/20160218172620_add_census_code_to_geozones.rb b/db/migrate/20160218172620_add_census_code_to_geozones.rb index 616518253..41de5cb14 100644 --- a/db/migrate/20160218172620_add_census_code_to_geozones.rb +++ b/db/migrate/20160218172620_add_census_code_to_geozones.rb @@ -1,4 +1,4 @@ -class AddCensusCodeToGeozones < ActiveRecord::Migration +class AddCensusCodeToGeozones < ActiveRecord::Migration[4.2] def change add_column :geozones, :census_code, :string end diff --git a/db/migrate/20160219111057_add_district_code_to_failed_census_call.rb b/db/migrate/20160219111057_add_district_code_to_failed_census_call.rb index 6e10dcd26..b68aea44e 100644 --- a/db/migrate/20160219111057_add_district_code_to_failed_census_call.rb +++ b/db/migrate/20160219111057_add_district_code_to_failed_census_call.rb @@ -1,4 +1,4 @@ -class AddDistrictCodeToFailedCensusCall < ActiveRecord::Migration +class AddDistrictCodeToFailedCensusCall < ActiveRecord::Migration[4.2] def change add_column :failed_census_calls, :district_code, :string end diff --git a/db/migrate/20160219172824_removes_external_link_from_debates.rb b/db/migrate/20160219172824_removes_external_link_from_debates.rb index 50d5ba1e8..b4b87b03a 100644 --- a/db/migrate/20160219172824_removes_external_link_from_debates.rb +++ b/db/migrate/20160219172824_removes_external_link_from_debates.rb @@ -1,4 +1,4 @@ -class RemovesExternalLinkFromDebates < ActiveRecord::Migration +class RemovesExternalLinkFromDebates < ActiveRecord::Migration[4.2] def change remove_column :debates, :external_link end diff --git a/db/migrate/20160220181602_add_association_to_spending_proposals.rb b/db/migrate/20160220181602_add_association_to_spending_proposals.rb index 17ded2bc3..d2822cd26 100644 --- a/db/migrate/20160220181602_add_association_to_spending_proposals.rb +++ b/db/migrate/20160220181602_add_association_to_spending_proposals.rb @@ -1,4 +1,4 @@ -class AddAssociationToSpendingProposals < ActiveRecord::Migration +class AddAssociationToSpendingProposals < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :association_name, :string end diff --git a/db/migrate/20160222145100_add_redeemable_code_to_user.rb b/db/migrate/20160222145100_add_redeemable_code_to_user.rb index 38cba9357..1f7639463 100644 --- a/db/migrate/20160222145100_add_redeemable_code_to_user.rb +++ b/db/migrate/20160222145100_add_redeemable_code_to_user.rb @@ -1,4 +1,4 @@ -class AddRedeemableCodeToUser < ActiveRecord::Migration +class AddRedeemableCodeToUser < ActiveRecord::Migration[4.2] def change add_column :users, :redeemable_code, :string end diff --git a/db/migrate/20160224101038_change_spending_proposals_fields.rb b/db/migrate/20160224101038_change_spending_proposals_fields.rb index 22a7270cb..34e466b9a 100644 --- a/db/migrate/20160224101038_change_spending_proposals_fields.rb +++ b/db/migrate/20160224101038_change_spending_proposals_fields.rb @@ -1,4 +1,4 @@ -class ChangeSpendingProposalsFields < ActiveRecord::Migration +class ChangeSpendingProposalsFields < ActiveRecord::Migration[4.2] def change remove_index :spending_proposals, column: :resolution diff --git a/db/migrate/20160224123110_create_valuation_assignments.rb b/db/migrate/20160224123110_create_valuation_assignments.rb index 7ec9a9df4..d39e16d6b 100644 --- a/db/migrate/20160224123110_create_valuation_assignments.rb +++ b/db/migrate/20160224123110_create_valuation_assignments.rb @@ -1,4 +1,4 @@ -class CreateValuationAssignments < ActiveRecord::Migration +class CreateValuationAssignments < ActiveRecord::Migration[4.2] def change create_table :valuation_assignments do |t| t.belongs_to :valuator diff --git a/db/migrate/20160225171916_add_assignments_counter_cache_to_spending_proposal.rb b/db/migrate/20160225171916_add_assignments_counter_cache_to_spending_proposal.rb index 89a3ac37b..7b1fc7dcf 100644 --- a/db/migrate/20160225171916_add_assignments_counter_cache_to_spending_proposal.rb +++ b/db/migrate/20160225171916_add_assignments_counter_cache_to_spending_proposal.rb @@ -1,4 +1,4 @@ -class AddAssignmentsCounterCacheToSpendingProposal < ActiveRecord::Migration +class AddAssignmentsCounterCacheToSpendingProposal < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :valuation_assignments_count, :integer, default: 0 end diff --git a/db/migrate/20160305113707_add_price_fields_to_spending_proposals.rb b/db/migrate/20160305113707_add_price_fields_to_spending_proposals.rb index dad22583d..62b000bb3 100644 --- a/db/migrate/20160305113707_add_price_fields_to_spending_proposals.rb +++ b/db/migrate/20160305113707_add_price_fields_to_spending_proposals.rb @@ -1,4 +1,4 @@ -class AddPriceFieldsToSpendingProposals < ActiveRecord::Migration +class AddPriceFieldsToSpendingProposals < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :price_first_year, :float end diff --git a/db/migrate/20160307150804_add_time_scope_to_spending_proposals.rb b/db/migrate/20160307150804_add_time_scope_to_spending_proposals.rb index 550c57061..dfd1eac92 100644 --- a/db/migrate/20160307150804_add_time_scope_to_spending_proposals.rb +++ b/db/migrate/20160307150804_add_time_scope_to_spending_proposals.rb @@ -1,4 +1,4 @@ -class AddTimeScopeToSpendingProposals < ActiveRecord::Migration +class AddTimeScopeToSpendingProposals < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :time_scope, :string end diff --git a/db/migrate/20160308103548_change_price_fields_in_spending_proposals.rb b/db/migrate/20160308103548_change_price_fields_in_spending_proposals.rb index 532d2662b..18f17a764 100644 --- a/db/migrate/20160308103548_change_price_fields_in_spending_proposals.rb +++ b/db/migrate/20160308103548_change_price_fields_in_spending_proposals.rb @@ -1,4 +1,4 @@ -class ChangePriceFieldsInSpendingProposals < ActiveRecord::Migration +class ChangePriceFieldsInSpendingProposals < ActiveRecord::Migration[4.2] def up change_column :spending_proposals, :price, :integer change_column :spending_proposals, :price_first_year, :integer diff --git a/db/migrate/20160308184050_change_price_fields_to_bigint.rb b/db/migrate/20160308184050_change_price_fields_to_bigint.rb index fd9000278..2cbb211d3 100644 --- a/db/migrate/20160308184050_change_price_fields_to_bigint.rb +++ b/db/migrate/20160308184050_change_price_fields_to_bigint.rb @@ -1,4 +1,4 @@ -class ChangePriceFieldsToBigint < ActiveRecord::Migration +class ChangePriceFieldsToBigint < ActiveRecord::Migration[4.2] def up change_column :spending_proposals, :price, :bigint change_column :spending_proposals, :price_first_year, :bigint diff --git a/db/migrate/20160315084335_add_featured_at_to_debates.rb b/db/migrate/20160315084335_add_featured_at_to_debates.rb index 81093aed3..5923f080e 100644 --- a/db/migrate/20160315084335_add_featured_at_to_debates.rb +++ b/db/migrate/20160315084335_add_featured_at_to_debates.rb @@ -1,4 +1,4 @@ -class AddFeaturedAtToDebates < ActiveRecord::Migration +class AddFeaturedAtToDebates < ActiveRecord::Migration[4.2] def change add_column :debates, :featured_at, :datetime end diff --git a/db/migrate/20160315092854_add_description_to_valuators.rb b/db/migrate/20160315092854_add_description_to_valuators.rb index d5527dc36..8adead628 100644 --- a/db/migrate/20160315092854_add_description_to_valuators.rb +++ b/db/migrate/20160315092854_add_description_to_valuators.rb @@ -1,4 +1,4 @@ -class AddDescriptionToValuators < ActiveRecord::Migration +class AddDescriptionToValuators < ActiveRecord::Migration[4.2] def change add_column :valuators, :description, :string end diff --git a/db/migrate/20160328152843_add_unfeasible_email_sent_at_to_spending_proposals.rb b/db/migrate/20160328152843_add_unfeasible_email_sent_at_to_spending_proposals.rb index bbe1dc6ec..4600b0e5f 100644 --- a/db/migrate/20160328152843_add_unfeasible_email_sent_at_to_spending_proposals.rb +++ b/db/migrate/20160328152843_add_unfeasible_email_sent_at_to_spending_proposals.rb @@ -1,4 +1,4 @@ -class AddUnfeasibleEmailSentAtToSpendingProposals < ActiveRecord::Migration +class AddUnfeasibleEmailSentAtToSpendingProposals < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :unfeasible_email_sent_at, :datetime, default: nil end diff --git a/db/migrate/20160329115418_add_votes_up_to_spending_proposals.rb b/db/migrate/20160329115418_add_votes_up_to_spending_proposals.rb index 3b0f2a7ad..9b00ffc50 100644 --- a/db/migrate/20160329115418_add_votes_up_to_spending_proposals.rb +++ b/db/migrate/20160329115418_add_votes_up_to_spending_proposals.rb @@ -1,4 +1,4 @@ -class AddVotesUpToSpendingProposals < ActiveRecord::Migration +class AddVotesUpToSpendingProposals < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :cached_votes_up, :integer, default: 0 end diff --git a/db/migrate/20160329160106_add_tsvector_to_spending_proposals.rb b/db/migrate/20160329160106_add_tsvector_to_spending_proposals.rb index c8c3d7f3e..ccdb08cc2 100644 --- a/db/migrate/20160329160106_add_tsvector_to_spending_proposals.rb +++ b/db/migrate/20160329160106_add_tsvector_to_spending_proposals.rb @@ -1,8 +1,8 @@ -class AddTsvectorToSpendingProposals < ActiveRecord::Migration +class AddTsvectorToSpendingProposals < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :tsv, :tsvector add_index :spending_proposals, :tsv, using: "gin" end -end \ No newline at end of file +end diff --git a/db/migrate/20160406163649_add_responsible_name_to_spending_proposals.rb b/db/migrate/20160406163649_add_responsible_name_to_spending_proposals.rb index 5749400bb..e28039588 100644 --- a/db/migrate/20160406163649_add_responsible_name_to_spending_proposals.rb +++ b/db/migrate/20160406163649_add_responsible_name_to_spending_proposals.rb @@ -1,4 +1,4 @@ -class AddResponsibleNameToSpendingProposals < ActiveRecord::Migration +class AddResponsibleNameToSpendingProposals < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :responsible_name, :string, limit: 60 end diff --git a/db/migrate/20160411161531_add_genre_and_dob_to_users.rb b/db/migrate/20160411161531_add_genre_and_dob_to_users.rb index aa8100fa3..59411ca7e 100644 --- a/db/migrate/20160411161531_add_genre_and_dob_to_users.rb +++ b/db/migrate/20160411161531_add_genre_and_dob_to_users.rb @@ -1,4 +1,4 @@ -class AddGenreAndDobToUsers < ActiveRecord::Migration +class AddGenreAndDobToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :genre, :string, index: true, limit: 10 add_column :users, :date_of_birth, :datetime, index: true diff --git a/db/migrate/20160413122359_rename_genre_to_gender.rb b/db/migrate/20160413122359_rename_genre_to_gender.rb index f0bccfc28..d24f511c0 100644 --- a/db/migrate/20160413122359_rename_genre_to_gender.rb +++ b/db/migrate/20160413122359_rename_genre_to_gender.rb @@ -1,4 +1,4 @@ -class RenameGenreToGender < ActiveRecord::Migration +class RenameGenreToGender < ActiveRecord::Migration[4.2] def change rename_column :users, :genre, :gender end diff --git a/db/migrate/20160415150524_add_physical_votes_to_spending_proposals.rb b/db/migrate/20160415150524_add_physical_votes_to_spending_proposals.rb index a90b1d1a7..6b345132c 100644 --- a/db/migrate/20160415150524_add_physical_votes_to_spending_proposals.rb +++ b/db/migrate/20160415150524_add_physical_votes_to_spending_proposals.rb @@ -1,4 +1,4 @@ -class AddPhysicalVotesToSpendingProposals < ActiveRecord::Migration +class AddPhysicalVotesToSpendingProposals < ActiveRecord::Migration[4.2] def change add_column :spending_proposals, :physical_votes, :integer, default: 0 end diff --git a/db/migrate/20160418144013_add_index_to_username.rb b/db/migrate/20160418144013_add_index_to_username.rb index 191f24ac6..d0481e826 100644 --- a/db/migrate/20160418144013_add_index_to_username.rb +++ b/db/migrate/20160418144013_add_index_to_username.rb @@ -1,4 +1,4 @@ -class AddIndexToUsername < ActiveRecord::Migration +class AddIndexToUsername < ActiveRecord::Migration[4.2] def change add_index :users, :username end diff --git a/db/migrate/20160418172919_activate_newsletter_by_default.rb b/db/migrate/20160418172919_activate_newsletter_by_default.rb index cdee85f1b..c75284656 100644 --- a/db/migrate/20160418172919_activate_newsletter_by_default.rb +++ b/db/migrate/20160418172919_activate_newsletter_by_default.rb @@ -1,4 +1,4 @@ -class ActivateNewsletterByDefault < ActiveRecord::Migration +class ActivateNewsletterByDefault < ActiveRecord::Migration[4.2] def change change_column :users, :newsletter, :boolean, default: true end diff --git a/db/migrate/20160420105023_add_retired_to_proposals.rb b/db/migrate/20160420105023_add_retired_to_proposals.rb index f818a9169..a8f7f4b92 100644 --- a/db/migrate/20160420105023_add_retired_to_proposals.rb +++ b/db/migrate/20160420105023_add_retired_to_proposals.rb @@ -1,4 +1,4 @@ -class AddRetiredToProposals < ActiveRecord::Migration +class AddRetiredToProposals < ActiveRecord::Migration[4.2] def change add_column :proposals, :retired_at, :datetime, default: nil end diff --git a/db/migrate/20160421090733_destroy_captcha_table.rb b/db/migrate/20160421090733_destroy_captcha_table.rb index 68d045d2f..4a214f428 100644 --- a/db/migrate/20160421090733_destroy_captcha_table.rb +++ b/db/migrate/20160421090733_destroy_captcha_table.rb @@ -1,4 +1,4 @@ -class DestroyCaptchaTable < ActiveRecord::Migration +class DestroyCaptchaTable < ActiveRecord::Migration[4.2] def change drop_table :simple_captcha_data end diff --git a/db/migrate/20160422094733_add_retired_texts_to_proposals.rb b/db/migrate/20160422094733_add_retired_texts_to_proposals.rb index 3c044477d..6ccc6d516 100644 --- a/db/migrate/20160422094733_add_retired_texts_to_proposals.rb +++ b/db/migrate/20160422094733_add_retired_texts_to_proposals.rb @@ -1,4 +1,4 @@ -class AddRetiredTextsToProposals < ActiveRecord::Migration +class AddRetiredTextsToProposals < ActiveRecord::Migration[4.2] def change add_column :proposals, :retired_reason, :string, default: nil add_column :proposals, :retired_explanation, :text, default: nil diff --git a/db/migrate/20160426211658_add_assignments_counter_cache_to_valuators.rb b/db/migrate/20160426211658_add_assignments_counter_cache_to_valuators.rb index 9b6b6f99d..6653900fd 100644 --- a/db/migrate/20160426211658_add_assignments_counter_cache_to_valuators.rb +++ b/db/migrate/20160426211658_add_assignments_counter_cache_to_valuators.rb @@ -1,4 +1,4 @@ -class AddAssignmentsCounterCacheToValuators < ActiveRecord::Migration +class AddAssignmentsCounterCacheToValuators < ActiveRecord::Migration[4.2] def change add_column :valuators, :spending_proposals_count, :integer, default: 0 end diff --git a/db/migrate/20160510161858_create_manager_role.rb b/db/migrate/20160510161858_create_manager_role.rb index 48ceb7e20..335564178 100644 --- a/db/migrate/20160510161858_create_manager_role.rb +++ b/db/migrate/20160510161858_create_manager_role.rb @@ -1,4 +1,4 @@ -class CreateManagerRole < ActiveRecord::Migration +class CreateManagerRole < ActiveRecord::Migration[4.2] def change create_table :managers do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/db/migrate/20160518141543_create_banners.rb b/db/migrate/20160518141543_create_banners.rb index efa8870a1..4199cf5d2 100644 --- a/db/migrate/20160518141543_create_banners.rb +++ b/db/migrate/20160518141543_create_banners.rb @@ -1,4 +1,4 @@ -class CreateBanners < ActiveRecord::Migration +class CreateBanners < ActiveRecord::Migration[4.2] def change create_table :banners do |t| t.string :title, limit: 80 @@ -16,4 +16,4 @@ class CreateBanners < ActiveRecord::Migration add_index :banners, :hidden_at end -end \ No newline at end of file +end diff --git a/db/migrate/20160518142529_create_budgets.rb b/db/migrate/20160518142529_create_budgets.rb index 943038472..9f3cbea82 100644 --- a/db/migrate/20160518142529_create_budgets.rb +++ b/db/migrate/20160518142529_create_budgets.rb @@ -1,4 +1,4 @@ -class CreateBudgets < ActiveRecord::Migration +class CreateBudgets < ActiveRecord::Migration[4.2] def change create_table :budgets do |t| t.string "name", limit: 30 diff --git a/db/migrate/20160518151245_create_budget_investments.rb b/db/migrate/20160518151245_create_budget_investments.rb index bdc77c967..a33b762ef 100644 --- a/db/migrate/20160518151245_create_budget_investments.rb +++ b/db/migrate/20160518151245_create_budget_investments.rb @@ -1,4 +1,4 @@ -class CreateBudgetInvestments < ActiveRecord::Migration +class CreateBudgetInvestments < ActiveRecord::Migration[4.2] def change create_table :budget_investments do |t| diff --git a/db/migrate/20160519144152_create_budget_ballots.rb b/db/migrate/20160519144152_create_budget_ballots.rb index 3131098b5..2f1a24a08 100644 --- a/db/migrate/20160519144152_create_budget_ballots.rb +++ b/db/migrate/20160519144152_create_budget_ballots.rb @@ -1,4 +1,4 @@ -class CreateBudgetBallots < ActiveRecord::Migration +class CreateBudgetBallots < ActiveRecord::Migration[4.2] def change create_table :budget_ballots do |t| t.references :geozone diff --git a/db/migrate/20160520100347_create_budget_ballot_lines.rb b/db/migrate/20160520100347_create_budget_ballot_lines.rb index 07377234d..28fc2d8e2 100644 --- a/db/migrate/20160520100347_create_budget_ballot_lines.rb +++ b/db/migrate/20160520100347_create_budget_ballot_lines.rb @@ -1,4 +1,4 @@ -class CreateBudgetBallotLines < ActiveRecord::Migration +class CreateBudgetBallotLines < ActiveRecord::Migration[4.2] def change create_table :budget_ballot_lines do |t| t.integer :ballot_id, index: true diff --git a/db/migrate/20160520111735_create_budget_heading.rb b/db/migrate/20160520111735_create_budget_heading.rb index bd9291d2f..ca83afb4e 100644 --- a/db/migrate/20160520111735_create_budget_heading.rb +++ b/db/migrate/20160520111735_create_budget_heading.rb @@ -1,4 +1,4 @@ -class CreateBudgetHeading < ActiveRecord::Migration +class CreateBudgetHeading < ActiveRecord::Migration[4.2] def change create_table :budget_headings do |t| t.references :group, index: true diff --git a/db/migrate/20160520114820_replace_geozones_by_headings_in_budgets.rb b/db/migrate/20160520114820_replace_geozones_by_headings_in_budgets.rb index 60e1e4f6c..dbc660450 100644 --- a/db/migrate/20160520114820_replace_geozones_by_headings_in_budgets.rb +++ b/db/migrate/20160520114820_replace_geozones_by_headings_in_budgets.rb @@ -1,4 +1,4 @@ -class ReplaceGeozonesByHeadingsInBudgets < ActiveRecord::Migration +class ReplaceGeozonesByHeadingsInBudgets < ActiveRecord::Migration[4.2] def change remove_column :budget_investments, :geozone_id remove_column :budget_ballots, :geozone_id diff --git a/db/migrate/20160520151954_add_budget_id_to_investments.rb b/db/migrate/20160520151954_add_budget_id_to_investments.rb index 8860be67c..430fb0db6 100644 --- a/db/migrate/20160520151954_add_budget_id_to_investments.rb +++ b/db/migrate/20160520151954_add_budget_id_to_investments.rb @@ -1,4 +1,4 @@ -class AddBudgetIdToInvestments < ActiveRecord::Migration +class AddBudgetIdToInvestments < ActiveRecord::Migration[4.2] def change add_reference :budget_investments, :budget, index: true end diff --git a/db/migrate/20160523095730_create_budget_valuator_assignments.rb b/db/migrate/20160523095730_create_budget_valuator_assignments.rb index 18686da0e..72702a246 100644 --- a/db/migrate/20160523095730_create_budget_valuator_assignments.rb +++ b/db/migrate/20160523095730_create_budget_valuator_assignments.rb @@ -1,4 +1,4 @@ -class CreateBudgetValuatorAssignments < ActiveRecord::Migration +class CreateBudgetValuatorAssignments < ActiveRecord::Migration[4.2] def change create_table :budget_valuator_assignments, index: false do |t| t.belongs_to :valuator diff --git a/db/migrate/20160523143320_deletes_heading_id_from_ballot.rb b/db/migrate/20160523143320_deletes_heading_id_from_ballot.rb index 3a7d17e67..83cb9963d 100644 --- a/db/migrate/20160523143320_deletes_heading_id_from_ballot.rb +++ b/db/migrate/20160523143320_deletes_heading_id_from_ballot.rb @@ -1,4 +1,4 @@ -class DeletesHeadingIdFromBallot < ActiveRecord::Migration +class DeletesHeadingIdFromBallot < ActiveRecord::Migration[4.2] def change remove_column :budget_ballots, :heading_id end diff --git a/db/migrate/20160523144313_add_budget_investments_count_to_valuators.rb b/db/migrate/20160523144313_add_budget_investments_count_to_valuators.rb index 9ec741951..986d547c4 100644 --- a/db/migrate/20160523144313_add_budget_investments_count_to_valuators.rb +++ b/db/migrate/20160523144313_add_budget_investments_count_to_valuators.rb @@ -1,4 +1,4 @@ -class AddBudgetInvestmentsCountToValuators < ActiveRecord::Migration +class AddBudgetInvestmentsCountToValuators < ActiveRecord::Migration[4.2] def change add_column :valuators, :budget_investments_count, :integer, default: 0 end diff --git a/db/migrate/20160523150146_rename_bi_valuation_count.rb b/db/migrate/20160523150146_rename_bi_valuation_count.rb index b7b41e6e1..6b130c63a 100644 --- a/db/migrate/20160523150146_rename_bi_valuation_count.rb +++ b/db/migrate/20160523150146_rename_bi_valuation_count.rb @@ -1,4 +1,4 @@ -class RenameBiValuationCount < ActiveRecord::Migration +class RenameBiValuationCount < ActiveRecord::Migration[4.2] def change rename_column :budget_investments, :valuation_assignments_count, :valuator_assignments_count end diff --git a/db/migrate/20160523164449_add_responsible_name_to_budget_investments.rb b/db/migrate/20160523164449_add_responsible_name_to_budget_investments.rb index 46576d059..6e2e8bc46 100644 --- a/db/migrate/20160523164449_add_responsible_name_to_budget_investments.rb +++ b/db/migrate/20160523164449_add_responsible_name_to_budget_investments.rb @@ -1,4 +1,4 @@ -class AddResponsibleNameToBudgetInvestments < ActiveRecord::Migration +class AddResponsibleNameToBudgetInvestments < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :responsible_name, :string end diff --git a/db/migrate/20160524143107_add_heading_id_to_budget_ballot.rb b/db/migrate/20160524143107_add_heading_id_to_budget_ballot.rb index 2bc254fbe..a2bb01f2d 100644 --- a/db/migrate/20160524143107_add_heading_id_to_budget_ballot.rb +++ b/db/migrate/20160524143107_add_heading_id_to_budget_ballot.rb @@ -1,4 +1,4 @@ -class AddHeadingIdToBudgetBallot < ActiveRecord::Migration +class AddHeadingIdToBudgetBallot < ActiveRecord::Migration[4.2] def change add_column :budget_ballots, :heading_id, :integer add_index :budget_ballots, :heading_id diff --git a/db/migrate/20160524144005_add_price_to_budget.rb b/db/migrate/20160524144005_add_price_to_budget.rb index 14c96dd7a..b7a1ec063 100644 --- a/db/migrate/20160524144005_add_price_to_budget.rb +++ b/db/migrate/20160524144005_add_price_to_budget.rb @@ -1,4 +1,4 @@ -class AddPriceToBudget < ActiveRecord::Migration +class AddPriceToBudget < ActiveRecord::Migration[4.2] def change add_column :budgets, :price, :integer end diff --git a/db/migrate/20160531102008_add_budget_investments_count_to_tags.rb b/db/migrate/20160531102008_add_budget_investments_count_to_tags.rb index 256adcc0c..32f75ca03 100644 --- a/db/migrate/20160531102008_add_budget_investments_count_to_tags.rb +++ b/db/migrate/20160531102008_add_budget_investments_count_to_tags.rb @@ -1,4 +1,4 @@ -class AddBudgetInvestmentsCountToTags < ActiveRecord::Migration +class AddBudgetInvestmentsCountToTags < ActiveRecord::Migration[4.2] def change add_column :tags, "budget/investments_count", :integer, default: 0 end diff --git a/db/migrate/20160601103338_create_proposal_notifications.rb b/db/migrate/20160601103338_create_proposal_notifications.rb index 97760da6b..d1a72d179 100644 --- a/db/migrate/20160601103338_create_proposal_notifications.rb +++ b/db/migrate/20160601103338_create_proposal_notifications.rb @@ -1,4 +1,4 @@ -class CreateProposalNotifications < ActiveRecord::Migration +class CreateProposalNotifications < ActiveRecord::Migration[4.2] def change create_table :proposal_notifications do |t| t.string :title diff --git a/db/migrate/20160606102427_add_email_on_proposal_notification_to_users.rb b/db/migrate/20160606102427_add_email_on_proposal_notification_to_users.rb index 84753eb50..a260edd87 100644 --- a/db/migrate/20160606102427_add_email_on_proposal_notification_to_users.rb +++ b/db/migrate/20160606102427_add_email_on_proposal_notification_to_users.rb @@ -1,4 +1,4 @@ -class AddEmailOnProposalNotificationToUsers < ActiveRecord::Migration +class AddEmailOnProposalNotificationToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :email_on_proposal_notification, :boolean, default: true end diff --git a/db/migrate/20160608174104_create_direct_messages.rb b/db/migrate/20160608174104_create_direct_messages.rb index 0cdcd6659..61f155af9 100644 --- a/db/migrate/20160608174104_create_direct_messages.rb +++ b/db/migrate/20160608174104_create_direct_messages.rb @@ -1,4 +1,4 @@ -class CreateDirectMessages < ActiveRecord::Migration +class CreateDirectMessages < ActiveRecord::Migration[4.2] def change create_table :direct_messages do |t| t.integer :sender_id diff --git a/db/migrate/20160609110023_create_budget_group.rb b/db/migrate/20160609110023_create_budget_group.rb index fb6cbcd1c..9ff35391d 100644 --- a/db/migrate/20160609110023_create_budget_group.rb +++ b/db/migrate/20160609110023_create_budget_group.rb @@ -1,4 +1,4 @@ -class CreateBudgetGroup < ActiveRecord::Migration +class CreateBudgetGroup < ActiveRecord::Migration[4.2] def change create_table :budget_groups do |t| t.references :budget diff --git a/db/migrate/20160609142017_remove_price_from_budget.rb b/db/migrate/20160609142017_remove_price_from_budget.rb index 366fdef5f..6a7f2f9c3 100644 --- a/db/migrate/20160609142017_remove_price_from_budget.rb +++ b/db/migrate/20160609142017_remove_price_from_budget.rb @@ -1,4 +1,4 @@ -class RemovePriceFromBudget < ActiveRecord::Migration +class RemovePriceFromBudget < ActiveRecord::Migration[4.2] def change remove_column :budgets, :price, :integer end diff --git a/db/migrate/20160609152026_remove_budget_id_from_investments.rb b/db/migrate/20160609152026_remove_budget_id_from_investments.rb index 69890c2e9..9fc6b2367 100644 --- a/db/migrate/20160609152026_remove_budget_id_from_investments.rb +++ b/db/migrate/20160609152026_remove_budget_id_from_investments.rb @@ -1,4 +1,4 @@ -class RemoveBudgetIdFromInvestments < ActiveRecord::Migration +class RemoveBudgetIdFromInvestments < ActiveRecord::Migration[4.2] def change remove_column :budget_investments, :budget_id, :integer end diff --git a/db/migrate/20160610094658_desnormalize_ballot_line.rb b/db/migrate/20160610094658_desnormalize_ballot_line.rb index b4eee7dc2..afbf85484 100644 --- a/db/migrate/20160610094658_desnormalize_ballot_line.rb +++ b/db/migrate/20160610094658_desnormalize_ballot_line.rb @@ -1,4 +1,4 @@ -class DesnormalizeBallotLine < ActiveRecord::Migration +class DesnormalizeBallotLine < ActiveRecord::Migration[4.2] def change add_column :budget_ballot_lines, :budget_id, :integer, index: true add_column :budget_ballot_lines, :group_id, :integer, index: true diff --git a/db/migrate/20160613150659_add_email_digest_to_users.rb b/db/migrate/20160613150659_add_email_digest_to_users.rb index d127af78e..f10d3765b 100644 --- a/db/migrate/20160613150659_add_email_digest_to_users.rb +++ b/db/migrate/20160613150659_add_email_digest_to_users.rb @@ -1,4 +1,4 @@ -class AddEmailDigestToUsers < ActiveRecord::Migration +class AddEmailDigestToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :email_digest, :boolean, default: true end diff --git a/db/migrate/20160614091639_remove_heading_id_from_ballot.rb b/db/migrate/20160614091639_remove_heading_id_from_ballot.rb index f46b93424..9e11882a8 100644 --- a/db/migrate/20160614091639_remove_heading_id_from_ballot.rb +++ b/db/migrate/20160614091639_remove_heading_id_from_ballot.rb @@ -1,4 +1,4 @@ -class RemoveHeadingIdFromBallot < ActiveRecord::Migration +class RemoveHeadingIdFromBallot < ActiveRecord::Migration[4.2] def change remove_column :budget_ballots, :heading_id, :integer end diff --git a/db/migrate/20160614160949_add_email_on_direct_messages_to_users.rb b/db/migrate/20160614160949_add_email_on_direct_messages_to_users.rb index db18e3f27..f9755dca3 100644 --- a/db/migrate/20160614160949_add_email_on_direct_messages_to_users.rb +++ b/db/migrate/20160614160949_add_email_on_direct_messages_to_users.rb @@ -1,4 +1,4 @@ -class AddEmailOnDirectMessagesToUsers < ActiveRecord::Migration +class AddEmailOnDirectMessagesToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :email_on_direct_message, :boolean, default: true end diff --git a/db/migrate/20160617172616_add_badge_to_users.rb b/db/migrate/20160617172616_add_badge_to_users.rb index 2f634aa49..c49441332 100644 --- a/db/migrate/20160617172616_add_badge_to_users.rb +++ b/db/migrate/20160617172616_add_badge_to_users.rb @@ -1,4 +1,4 @@ -class AddBadgeToUsers < ActiveRecord::Migration +class AddBadgeToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :official_position_badge, :boolean, default: false end diff --git a/db/migrate/20160803154011_add_emailed_at_to_notifications.rb b/db/migrate/20160803154011_add_emailed_at_to_notifications.rb index 83e38b00f..69aec73c6 100644 --- a/db/migrate/20160803154011_add_emailed_at_to_notifications.rb +++ b/db/migrate/20160803154011_add_emailed_at_to_notifications.rb @@ -1,4 +1,4 @@ -class AddEmailedAtToNotifications < ActiveRecord::Migration +class AddEmailedAtToNotifications < ActiveRecord::Migration[4.2] def change add_column :notifications, :emailed_at, :datetime end diff --git a/db/migrate/20160901104320_add_password_expired.rb b/db/migrate/20160901104320_add_password_expired.rb index aa759dd61..c6bcc6070 100644 --- a/db/migrate/20160901104320_add_password_expired.rb +++ b/db/migrate/20160901104320_add_password_expired.rb @@ -1,4 +1,4 @@ -class AddPasswordExpired < ActiveRecord::Migration +class AddPasswordExpired < ActiveRecord::Migration[4.2] def change add_column :users, :password_changed_at, :datetime add_index :users, :password_changed_at diff --git a/db/migrate/20160905092539_denormalize_investments.rb b/db/migrate/20160905092539_denormalize_investments.rb index d28291c4e..bed96e1d1 100644 --- a/db/migrate/20160905092539_denormalize_investments.rb +++ b/db/migrate/20160905092539_denormalize_investments.rb @@ -1,4 +1,4 @@ -class DenormalizeInvestments < ActiveRecord::Migration +class DenormalizeInvestments < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :budget_id, :integer, index: true add_column :budget_investments, :group_id, :integer, index: true diff --git a/db/migrate/20160914110004_create_polls.rb b/db/migrate/20160914110004_create_polls.rb index 9dd67d9ba..2359bce08 100644 --- a/db/migrate/20160914110004_create_polls.rb +++ b/db/migrate/20160914110004_create_polls.rb @@ -1,4 +1,4 @@ -class CreatePolls < ActiveRecord::Migration +class CreatePolls < ActiveRecord::Migration[4.2] def change create_table :polls do |t| t.string :name diff --git a/db/migrate/20160914110039_create_poll_officers.rb b/db/migrate/20160914110039_create_poll_officers.rb index 329220d40..cf6665af1 100644 --- a/db/migrate/20160914110039_create_poll_officers.rb +++ b/db/migrate/20160914110039_create_poll_officers.rb @@ -1,4 +1,4 @@ -class CreatePollOfficers < ActiveRecord::Migration +class CreatePollOfficers < ActiveRecord::Migration[4.2] def change create_table :poll_officers do |t| t.integer :user_id diff --git a/db/migrate/20160914172016_create_poll_voters.rb b/db/migrate/20160914172016_create_poll_voters.rb index df5bb4585..a3a75a771 100644 --- a/db/migrate/20160914172016_create_poll_voters.rb +++ b/db/migrate/20160914172016_create_poll_voters.rb @@ -1,4 +1,4 @@ -class CreatePollVoters < ActiveRecord::Migration +class CreatePollVoters < ActiveRecord::Migration[4.2] def change create_table :poll_voters do |t| t.integer :booth_id diff --git a/db/migrate/20160914172535_create_poll_booths.rb b/db/migrate/20160914172535_create_poll_booths.rb index a474aba49..f3dfb3781 100644 --- a/db/migrate/20160914172535_create_poll_booths.rb +++ b/db/migrate/20160914172535_create_poll_booths.rb @@ -1,4 +1,4 @@ -class CreatePollBooths < ActiveRecord::Migration +class CreatePollBooths < ActiveRecord::Migration[4.2] def change create_table :poll_booths do |t| t.string :name diff --git a/db/migrate/20160926090107_add_location_to_booths.rb b/db/migrate/20160926090107_add_location_to_booths.rb index 146f55d41..3dfc2fda9 100644 --- a/db/migrate/20160926090107_add_location_to_booths.rb +++ b/db/migrate/20160926090107_add_location_to_booths.rb @@ -1,4 +1,4 @@ -class AddLocationToBooths < ActiveRecord::Migration +class AddLocationToBooths < ActiveRecord::Migration[4.2] def change add_column :poll_booths, :location, :string end diff --git a/db/migrate/20160928113143_create_officing_booths.rb b/db/migrate/20160928113143_create_officing_booths.rb index 00483fe00..785931b71 100644 --- a/db/migrate/20160928113143_create_officing_booths.rb +++ b/db/migrate/20160928113143_create_officing_booths.rb @@ -1,4 +1,4 @@ -class CreateOfficingBooths < ActiveRecord::Migration +class CreateOfficingBooths < ActiveRecord::Migration[4.2] def change create_table :poll_officing_booths do |t| t.belongs_to :officer diff --git a/db/migrate/20161020112156_add_dates_to_polls.rb b/db/migrate/20161020112156_add_dates_to_polls.rb index d504930ae..aaf0f33b8 100644 --- a/db/migrate/20161020112156_add_dates_to_polls.rb +++ b/db/migrate/20161020112156_add_dates_to_polls.rb @@ -1,4 +1,4 @@ -class AddDatesToPolls < ActiveRecord::Migration +class AddDatesToPolls < ActiveRecord::Migration[4.2] def change add_column :polls, :starts_at, :datetime add_column :polls, :ends_at, :datetime diff --git a/db/migrate/20161028104156_create_poll_questions.rb b/db/migrate/20161028104156_create_poll_questions.rb index 13c8ac1e8..ae72389d2 100644 --- a/db/migrate/20161028104156_create_poll_questions.rb +++ b/db/migrate/20161028104156_create_poll_questions.rb @@ -1,4 +1,4 @@ -class CreatePollQuestions < ActiveRecord::Migration +class CreatePollQuestions < ActiveRecord::Migration[4.2] def change create_table :poll_questions do |t| t.references :proposal, index: true, foreign_key: true diff --git a/db/migrate/20161028143204_create_geozones_poll_questions.rb b/db/migrate/20161028143204_create_geozones_poll_questions.rb index 68077c510..140f7fc2b 100644 --- a/db/migrate/20161028143204_create_geozones_poll_questions.rb +++ b/db/migrate/20161028143204_create_geozones_poll_questions.rb @@ -1,4 +1,4 @@ -class CreateGeozonesPollQuestions < ActiveRecord::Migration +class CreateGeozonesPollQuestions < ActiveRecord::Migration[4.2] def change create_table :geozones_poll_questions do |t| t.references :geozone, index: true, foreign_key: true diff --git a/db/migrate/20161102133838_default_password_changed_at.rb b/db/migrate/20161102133838_default_password_changed_at.rb index 9df2a26a6..ec58525da 100644 --- a/db/migrate/20161102133838_default_password_changed_at.rb +++ b/db/migrate/20161102133838_default_password_changed_at.rb @@ -1,4 +1,4 @@ -class DefaultPasswordChangedAt < ActiveRecord::Migration +class DefaultPasswordChangedAt < ActiveRecord::Migration[4.2] def change change_column :users, :password_changed_at, :datetime, null: false, default: Time.now end diff --git a/db/migrate/20161107124207_add_all_geozones_to_poll_questions.rb b/db/migrate/20161107124207_add_all_geozones_to_poll_questions.rb index 15ed41ba5..1f8d20051 100644 --- a/db/migrate/20161107124207_add_all_geozones_to_poll_questions.rb +++ b/db/migrate/20161107124207_add_all_geozones_to_poll_questions.rb @@ -1,4 +1,4 @@ -class AddAllGeozonesToPollQuestions < ActiveRecord::Migration +class AddAllGeozonesToPollQuestions < ActiveRecord::Migration[4.2] def change add_column :poll_questions, :all_geozones, :boolean, default: false end diff --git a/db/migrate/20161107174423_create_poll_partial_result.rb b/db/migrate/20161107174423_create_poll_partial_result.rb index a4f91a4f9..da75fe853 100644 --- a/db/migrate/20161107174423_create_poll_partial_result.rb +++ b/db/migrate/20161107174423_create_poll_partial_result.rb @@ -1,4 +1,4 @@ -class CreatePollPartialResult < ActiveRecord::Migration +class CreatePollPartialResult < ActiveRecord::Migration[4.2] def change create_table :poll_partial_results do |t| t.integer :question_id, index: true diff --git a/db/migrate/20161117115841_rename_legislations_to_legacy_legislations.rb b/db/migrate/20161117115841_rename_legislations_to_legacy_legislations.rb index d8eaa76c0..ef9b79ed5 100644 --- a/db/migrate/20161117115841_rename_legislations_to_legacy_legislations.rb +++ b/db/migrate/20161117115841_rename_legislations_to_legacy_legislations.rb @@ -1,4 +1,4 @@ -class RenameLegislationsToLegacyLegislations < ActiveRecord::Migration +class RenameLegislationsToLegacyLegislations < ActiveRecord::Migration[4.2] def change rename_table :legislations, :legacy_legislations rename_column :annotations, :legislation_id, :legacy_legislation_id diff --git a/db/migrate/20161117135624_create_legislation_processes.rb b/db/migrate/20161117135624_create_legislation_processes.rb index 099a84e65..71e2079b6 100644 --- a/db/migrate/20161117135624_create_legislation_processes.rb +++ b/db/migrate/20161117135624_create_legislation_processes.rb @@ -1,4 +1,4 @@ -class CreateLegislationProcesses < ActiveRecord::Migration +class CreateLegislationProcesses < ActiveRecord::Migration[4.2] def change create_table :legislation_processes do |t| t.string :title diff --git a/db/migrate/20161122101702_remove_question_from_poll_questions.rb b/db/migrate/20161122101702_remove_question_from_poll_questions.rb index 2532b2948..00411ac26 100644 --- a/db/migrate/20161122101702_remove_question_from_poll_questions.rb +++ b/db/migrate/20161122101702_remove_question_from_poll_questions.rb @@ -1,4 +1,4 @@ -class RemoveQuestionFromPollQuestions < ActiveRecord::Migration +class RemoveQuestionFromPollQuestions < ActiveRecord::Migration[4.2] def change remove_column :poll_questions, :question end diff --git a/db/migrate/20161129011737_add_tsv_to_poll_questions.rb b/db/migrate/20161129011737_add_tsv_to_poll_questions.rb index a6a44f13d..3e889f548 100644 --- a/db/migrate/20161129011737_add_tsv_to_poll_questions.rb +++ b/db/migrate/20161129011737_add_tsv_to_poll_questions.rb @@ -1,4 +1,4 @@ -class AddTsvToPollQuestions < ActiveRecord::Migration +class AddTsvToPollQuestions < ActiveRecord::Migration[4.2] def up add_column :poll_questions, :tsv, :tsvector add_index :poll_questions, :tsv, using: "gin" diff --git a/db/migrate/20161130122604_remove_poll_id_from_booth.rb b/db/migrate/20161130122604_remove_poll_id_from_booth.rb index a84b1a70a..624893080 100644 --- a/db/migrate/20161130122604_remove_poll_id_from_booth.rb +++ b/db/migrate/20161130122604_remove_poll_id_from_booth.rb @@ -1,4 +1,4 @@ -class RemovePollIdFromBooth < ActiveRecord::Migration +class RemovePollIdFromBooth < ActiveRecord::Migration[4.2] def change remove_column :poll_booths, :poll_id, :integer end diff --git a/db/migrate/20161130123347_create_poll_booth_assignments.rb b/db/migrate/20161130123347_create_poll_booth_assignments.rb index 36a2b9d64..dfcc0f71d 100644 --- a/db/migrate/20161130123347_create_poll_booth_assignments.rb +++ b/db/migrate/20161130123347_create_poll_booth_assignments.rb @@ -1,4 +1,4 @@ -class CreatePollBoothAssignments < ActiveRecord::Migration +class CreatePollBoothAssignments < ActiveRecord::Migration[4.2] def change create_table :poll_booth_assignments do |t| t.integer :booth_id diff --git a/db/migrate/20161205110441_create_legislation_draft_versions.rb b/db/migrate/20161205110441_create_legislation_draft_versions.rb index 1eb15eebe..1d4afb377 100644 --- a/db/migrate/20161205110441_create_legislation_draft_versions.rb +++ b/db/migrate/20161205110441_create_legislation_draft_versions.rb @@ -1,4 +1,4 @@ -class CreateLegislationDraftVersions < ActiveRecord::Migration +class CreateLegislationDraftVersions < ActiveRecord::Migration[4.2] def change create_table :legislation_draft_versions do |t| t.references :legislation_process, index: true, foreign_key: true diff --git a/db/migrate/20161206130836_delete_officing_booths.rb b/db/migrate/20161206130836_delete_officing_booths.rb index 2ef1180ab..86bc9c166 100644 --- a/db/migrate/20161206130836_delete_officing_booths.rb +++ b/db/migrate/20161206130836_delete_officing_booths.rb @@ -1,4 +1,4 @@ -class DeleteOfficingBooths < ActiveRecord::Migration +class DeleteOfficingBooths < ActiveRecord::Migration[4.2] def self.up drop_table :poll_officing_booths end diff --git a/db/migrate/20161206131125_create_poll_officer_assignments.rb b/db/migrate/20161206131125_create_poll_officer_assignments.rb index f3a40017c..bc324f086 100644 --- a/db/migrate/20161206131125_create_poll_officer_assignments.rb +++ b/db/migrate/20161206131125_create_poll_officer_assignments.rb @@ -1,4 +1,4 @@ -class CreatePollOfficerAssignments < ActiveRecord::Migration +class CreatePollOfficerAssignments < ActiveRecord::Migration[4.2] def change create_table :poll_officer_assignments do |t| t.integer :booth_assignment_id diff --git a/db/migrate/20161206132126_rename_booth_id_to_booth_assignment_id.rb b/db/migrate/20161206132126_rename_booth_id_to_booth_assignment_id.rb index a1b59c749..95ed6dbcf 100644 --- a/db/migrate/20161206132126_rename_booth_id_to_booth_assignment_id.rb +++ b/db/migrate/20161206132126_rename_booth_id_to_booth_assignment_id.rb @@ -1,4 +1,4 @@ -class RenameBoothIdToBoothAssignmentId < ActiveRecord::Migration +class RenameBoothIdToBoothAssignmentId < ActiveRecord::Migration[4.2] def change remove_column :poll_voters, :booth_id, :integer diff --git a/db/migrate/20161207181001_remove_poll_id_from_voter.rb b/db/migrate/20161207181001_remove_poll_id_from_voter.rb index 5a7012460..dc7d18b61 100644 --- a/db/migrate/20161207181001_remove_poll_id_from_voter.rb +++ b/db/migrate/20161207181001_remove_poll_id_from_voter.rb @@ -1,4 +1,4 @@ -class RemovePollIdFromVoter < ActiveRecord::Migration +class RemovePollIdFromVoter < ActiveRecord::Migration[4.2] def change remove_column :poll_voters, :poll_id, :integer end diff --git a/db/migrate/20161213144031_add_body_html_to_draft_versions.rb b/db/migrate/20161213144031_add_body_html_to_draft_versions.rb index c0a05c809..328f69894 100644 --- a/db/migrate/20161213144031_add_body_html_to_draft_versions.rb +++ b/db/migrate/20161213144031_add_body_html_to_draft_versions.rb @@ -1,4 +1,4 @@ -class AddBodyHtmlToDraftVersions < ActiveRecord::Migration +class AddBodyHtmlToDraftVersions < ActiveRecord::Migration[4.2] def change add_column :legislation_draft_versions, :body_html, :text end diff --git a/db/migrate/20161214212918_create_signature_sheets.rb b/db/migrate/20161214212918_create_signature_sheets.rb index d34728a34..c15fd1b22 100644 --- a/db/migrate/20161214212918_create_signature_sheets.rb +++ b/db/migrate/20161214212918_create_signature_sheets.rb @@ -1,4 +1,4 @@ -class CreateSignatureSheets < ActiveRecord::Migration +class CreateSignatureSheets < ActiveRecord::Migration[4.2] def change create_table :signature_sheets do |t| t.references :signable, polymorphic: true @@ -8,4 +8,4 @@ class CreateSignatureSheets < ActiveRecord::Migration t.timestamps end end -end \ No newline at end of file +end diff --git a/db/migrate/20161214233817_create_signatures.rb b/db/migrate/20161214233817_create_signatures.rb index fd6b53d3a..c9cc65056 100644 --- a/db/migrate/20161214233817_create_signatures.rb +++ b/db/migrate/20161214233817_create_signatures.rb @@ -1,4 +1,4 @@ -class CreateSignatures < ActiveRecord::Migration +class CreateSignatures < ActiveRecord::Migration[4.2] def change create_table :signatures do |t| t.references :signature_sheet diff --git a/db/migrate/20161220120037_create_legislation_questions.rb b/db/migrate/20161220120037_create_legislation_questions.rb index 41bc3497f..a62a9d1c0 100644 --- a/db/migrate/20161220120037_create_legislation_questions.rb +++ b/db/migrate/20161220120037_create_legislation_questions.rb @@ -1,4 +1,4 @@ -class CreateLegislationQuestions < ActiveRecord::Migration +class CreateLegislationQuestions < ActiveRecord::Migration[4.2] def change create_table :legislation_questions do |t| t.references :legislation_process, index: true diff --git a/db/migrate/20161221131403_add_signture_id_to_votes.rb b/db/migrate/20161221131403_add_signture_id_to_votes.rb index 28851fdac..37850640f 100644 --- a/db/migrate/20161221131403_add_signture_id_to_votes.rb +++ b/db/migrate/20161221131403_add_signture_id_to_votes.rb @@ -1,4 +1,4 @@ -class AddSigntureIdToVotes < ActiveRecord::Migration +class AddSigntureIdToVotes < ActiveRecord::Migration[4.2] def change add_reference :votes, :signature, index: true end diff --git a/db/migrate/20161221151239_add_created_from_signature_to_users.rb b/db/migrate/20161221151239_add_created_from_signature_to_users.rb index 214bd43cb..7ec3d9a02 100644 --- a/db/migrate/20161221151239_add_created_from_signature_to_users.rb +++ b/db/migrate/20161221151239_add_created_from_signature_to_users.rb @@ -1,4 +1,4 @@ -class AddCreatedFromSignatureToUsers < ActiveRecord::Migration +class AddCreatedFromSignatureToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :created_from_signature, :boolean, default: false end diff --git a/db/migrate/20161221172447_add_selected_to_budget_investment.rb b/db/migrate/20161221172447_add_selected_to_budget_investment.rb index de983aee4..7f4f9bd91 100644 --- a/db/migrate/20161221172447_add_selected_to_budget_investment.rb +++ b/db/migrate/20161221172447_add_selected_to_budget_investment.rb @@ -1,4 +1,4 @@ -class AddSelectedToBudgetInvestment < ActiveRecord::Migration +class AddSelectedToBudgetInvestment < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :selected, :bool, default: false, index: true end diff --git a/db/migrate/20161222115744_create_legislation_answers.rb b/db/migrate/20161222115744_create_legislation_answers.rb index 0c8170d68..3d1223d4a 100644 --- a/db/migrate/20161222115744_create_legislation_answers.rb +++ b/db/migrate/20161222115744_create_legislation_answers.rb @@ -1,4 +1,4 @@ -class CreateLegislationAnswers < ActiveRecord::Migration +class CreateLegislationAnswers < ActiveRecord::Migration[4.2] def change create_table :legislation_answers do |t| t.references :legislation_question, index: true diff --git a/db/migrate/20161222171716_add_comments_count_to_legislation_questions.rb b/db/migrate/20161222171716_add_comments_count_to_legislation_questions.rb index e71a8879b..e2a5b6f29 100644 --- a/db/migrate/20161222171716_add_comments_count_to_legislation_questions.rb +++ b/db/migrate/20161222171716_add_comments_count_to_legislation_questions.rb @@ -1,4 +1,4 @@ -class AddCommentsCountToLegislationQuestions < ActiveRecord::Migration +class AddCommentsCountToLegislationQuestions < ActiveRecord::Migration[4.2] def change add_column :legislation_questions, :comments_count, :integer, default: 0 end diff --git a/db/migrate/20161222180927_add_author_to_legislation_questions.rb b/db/migrate/20161222180927_add_author_to_legislation_questions.rb index a06190045..4631f9030 100644 --- a/db/migrate/20161222180927_add_author_to_legislation_questions.rb +++ b/db/migrate/20161222180927_add_author_to_legislation_questions.rb @@ -1,4 +1,4 @@ -class AddAuthorToLegislationQuestions < ActiveRecord::Migration +class AddAuthorToLegislationQuestions < ActiveRecord::Migration[4.2] def change add_column :legislation_questions, :author_id, :integer end diff --git a/db/migrate/20161227140109_add_date_to_officer_assignment.rb b/db/migrate/20161227140109_add_date_to_officer_assignment.rb index b7c88a37b..4a8c4f27d 100644 --- a/db/migrate/20161227140109_add_date_to_officer_assignment.rb +++ b/db/migrate/20161227140109_add_date_to_officer_assignment.rb @@ -1,4 +1,4 @@ -class AddDateToOfficerAssignment < ActiveRecord::Migration +class AddDateToOfficerAssignment < ActiveRecord::Migration[4.2] def change add_column :poll_officer_assignments, :date, :datetime end diff --git a/db/migrate/20161229110336_remove_physical_votes_from_proposals.rb b/db/migrate/20161229110336_remove_physical_votes_from_proposals.rb index 34e0e5e44..603f1d095 100644 --- a/db/migrate/20161229110336_remove_physical_votes_from_proposals.rb +++ b/db/migrate/20161229110336_remove_physical_votes_from_proposals.rb @@ -1,4 +1,4 @@ -class RemovePhysicalVotesFromProposals < ActiveRecord::Migration +class RemovePhysicalVotesFromProposals < ActiveRecord::Migration[4.2] def change remove_column :proposals, :physical_votes end diff --git a/db/migrate/20161229153505_add_location_to_budget_investments.rb b/db/migrate/20161229153505_add_location_to_budget_investments.rb index a58ee4fdd..15a5991c1 100644 --- a/db/migrate/20161229153505_add_location_to_budget_investments.rb +++ b/db/migrate/20161229153505_add_location_to_budget_investments.rb @@ -1,4 +1,4 @@ -class AddLocationToBudgetInvestments < ActiveRecord::Migration +class AddLocationToBudgetInvestments < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :location, :string end diff --git a/db/migrate/20161229213217_add_toc_html_to_draft_versions.rb b/db/migrate/20161229213217_add_toc_html_to_draft_versions.rb index f71070e52..5ceafa8bb 100644 --- a/db/migrate/20161229213217_add_toc_html_to_draft_versions.rb +++ b/db/migrate/20161229213217_add_toc_html_to_draft_versions.rb @@ -1,4 +1,4 @@ -class AddTocHtmlToDraftVersions < ActiveRecord::Migration +class AddTocHtmlToDraftVersions < ActiveRecord::Migration[4.2] def change add_column :legislation_draft_versions, :toc_html, :text end diff --git a/db/migrate/20161230172816_remove_valuating_from_budgets.rb b/db/migrate/20161230172816_remove_valuating_from_budgets.rb index 4b6e97e7f..96ec15303 100644 --- a/db/migrate/20161230172816_remove_valuating_from_budgets.rb +++ b/db/migrate/20161230172816_remove_valuating_from_budgets.rb @@ -1,4 +1,4 @@ -class RemoveValuatingFromBudgets < ActiveRecord::Migration +class RemoveValuatingFromBudgets < ActiveRecord::Migration[4.2] def change remove_column :budgets, :valuating, :bool end diff --git a/db/migrate/20161230174744_change_budget_description.rb b/db/migrate/20161230174744_change_budget_description.rb index 80de9dcf4..474a127db 100644 --- a/db/migrate/20161230174744_change_budget_description.rb +++ b/db/migrate/20161230174744_change_budget_description.rb @@ -1,4 +1,4 @@ -class ChangeBudgetDescription < ActiveRecord::Migration +class ChangeBudgetDescription < ActiveRecord::Migration[4.2] def change remove_column :budgets, :description, :text add_column :budgets, :description_accepting, :text diff --git a/db/migrate/20170102080432_adjust_budget_fields.rb b/db/migrate/20170102080432_adjust_budget_fields.rb index 7517d6429..c39afe8b1 100644 --- a/db/migrate/20170102080432_adjust_budget_fields.rb +++ b/db/migrate/20170102080432_adjust_budget_fields.rb @@ -1,4 +1,4 @@ -class AdjustBudgetFields < ActiveRecord::Migration +class AdjustBudgetFields < ActiveRecord::Migration[4.2] def change change_column :budgets, :phase, :string, limit: 40, default: 'accepting' end diff --git a/db/migrate/20170102114446_create_poll_recounts.rb b/db/migrate/20170102114446_create_poll_recounts.rb index 9643f5b0a..dd548361e 100644 --- a/db/migrate/20170102114446_create_poll_recounts.rb +++ b/db/migrate/20170102114446_create_poll_recounts.rb @@ -1,4 +1,4 @@ -class CreatePollRecounts < ActiveRecord::Migration +class CreatePollRecounts < ActiveRecord::Migration[4.2] def change create_table :poll_recounts do |t| t.integer :booth_assignment_id diff --git a/db/migrate/20170102170125_add_published_to_polls.rb b/db/migrate/20170102170125_add_published_to_polls.rb index 51da03f34..f62d54b7b 100644 --- a/db/migrate/20170102170125_add_published_to_polls.rb +++ b/db/migrate/20170102170125_add_published_to_polls.rb @@ -1,4 +1,4 @@ -class AddPublishedToPolls < ActiveRecord::Migration +class AddPublishedToPolls < ActiveRecord::Migration[4.2] def change add_column :polls, :published, :boolean, default: false end diff --git a/db/migrate/20170103125835_create_legislation_annotations.rb b/db/migrate/20170103125835_create_legislation_annotations.rb index 723bf3813..37ae3e42a 100644 --- a/db/migrate/20170103125835_create_legislation_annotations.rb +++ b/db/migrate/20170103125835_create_legislation_annotations.rb @@ -1,4 +1,4 @@ -class CreateLegislationAnnotations < ActiveRecord::Migration +class CreateLegislationAnnotations < ActiveRecord::Migration[4.2] def change create_table :legislation_annotations do |t| t.string :quote diff --git a/db/migrate/20170103170147_remove_geozone_id_from_budget_headings.rb b/db/migrate/20170103170147_remove_geozone_id_from_budget_headings.rb index bc8a9729c..7965c1e83 100644 --- a/db/migrate/20170103170147_remove_geozone_id_from_budget_headings.rb +++ b/db/migrate/20170103170147_remove_geozone_id_from_budget_headings.rb @@ -1,4 +1,4 @@ -class RemoveGeozoneIdFromBudgetHeadings < ActiveRecord::Migration +class RemoveGeozoneIdFromBudgetHeadings < ActiveRecord::Migration[4.2] def change remove_column :budget_headings, :geozone_id end diff --git a/db/migrate/20170103191711_add_date_and_officer_assignment_log_to_poll_recounts.rb b/db/migrate/20170103191711_add_date_and_officer_assignment_log_to_poll_recounts.rb index e0f813500..9fd98aa46 100644 --- a/db/migrate/20170103191711_add_date_and_officer_assignment_log_to_poll_recounts.rb +++ b/db/migrate/20170103191711_add_date_and_officer_assignment_log_to_poll_recounts.rb @@ -1,4 +1,4 @@ -class AddDateAndOfficerAssignmentLogToPollRecounts < ActiveRecord::Migration +class AddDateAndOfficerAssignmentLogToPollRecounts < ActiveRecord::Migration[4.2] def change add_column :poll_recounts, :date, :datetime add_column :poll_recounts, :officer_assignment_id_log, :text, default: "" diff --git a/db/migrate/20170105120836_add_comments_count_to_legislation_annotation.rb b/db/migrate/20170105120836_add_comments_count_to_legislation_annotation.rb index 39b2e6387..990369884 100644 --- a/db/migrate/20170105120836_add_comments_count_to_legislation_annotation.rb +++ b/db/migrate/20170105120836_add_comments_count_to_legislation_annotation.rb @@ -1,4 +1,4 @@ -class AddCommentsCountToLegislationAnnotation < ActiveRecord::Migration +class AddCommentsCountToLegislationAnnotation < ActiveRecord::Migration[4.2] def change add_column :legislation_annotations, :comments_count, :integer, default: 0 end diff --git a/db/migrate/20170105212047_rename_user_to_author_in_legislation_annotations.rb b/db/migrate/20170105212047_rename_user_to_author_in_legislation_annotations.rb index 55b70395b..e554ca5e9 100644 --- a/db/migrate/20170105212047_rename_user_to_author_in_legislation_annotations.rb +++ b/db/migrate/20170105212047_rename_user_to_author_in_legislation_annotations.rb @@ -1,4 +1,4 @@ -class RenameUserToAuthorInLegislationAnnotations < ActiveRecord::Migration +class RenameUserToAuthorInLegislationAnnotations < ActiveRecord::Migration[4.2] def change rename_column :legislation_annotations, :user_id, :author_id end diff --git a/db/migrate/20170105215410_add_failed_email_digests_count_to_users.rb b/db/migrate/20170105215410_add_failed_email_digests_count_to_users.rb index 44744ed98..1a1b0e704 100644 --- a/db/migrate/20170105215410_add_failed_email_digests_count_to_users.rb +++ b/db/migrate/20170105215410_add_failed_email_digests_count_to_users.rb @@ -1,4 +1,4 @@ -class AddFailedEmailDigestsCountToUsers < ActiveRecord::Migration +class AddFailedEmailDigestsCountToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :failed_email_digests_count, :integer, default: 0 end diff --git a/db/migrate/20170106130838_add_organization_name_field_to_budget_investment.rb b/db/migrate/20170106130838_add_organization_name_field_to_budget_investment.rb index dfe9eca06..df0f1eec6 100644 --- a/db/migrate/20170106130838_add_organization_name_field_to_budget_investment.rb +++ b/db/migrate/20170106130838_add_organization_name_field_to_budget_investment.rb @@ -1,4 +1,4 @@ -class AddOrganizationNameFieldToBudgetInvestment < ActiveRecord::Migration +class AddOrganizationNameFieldToBudgetInvestment < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :organization_name, :string end diff --git a/db/migrate/20170114154421_add_unfeasible_email_sent_at_to_budget_investments.rb b/db/migrate/20170114154421_add_unfeasible_email_sent_at_to_budget_investments.rb index dbd1a203b..f606e5792 100644 --- a/db/migrate/20170114154421_add_unfeasible_email_sent_at_to_budget_investments.rb +++ b/db/migrate/20170114154421_add_unfeasible_email_sent_at_to_budget_investments.rb @@ -1,4 +1,4 @@ -class AddUnfeasibleEmailSentAtToBudgetInvestments < ActiveRecord::Migration +class AddUnfeasibleEmailSentAtToBudgetInvestments < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :unfeasible_email_sent_at, :datetime end diff --git a/db/migrate/20170120153244_move_geozones_from_poll_questions_to_polls.rb b/db/migrate/20170120153244_move_geozones_from_poll_questions_to_polls.rb index a2606c370..a94cde61c 100644 --- a/db/migrate/20170120153244_move_geozones_from_poll_questions_to_polls.rb +++ b/db/migrate/20170120153244_move_geozones_from_poll_questions_to_polls.rb @@ -1,4 +1,4 @@ -class MoveGeozonesFromPollQuestionsToPolls < ActiveRecord::Migration +class MoveGeozonesFromPollQuestionsToPolls < ActiveRecord::Migration[4.2] def change drop_table :geozones_poll_questions diff --git a/db/migrate/20170120161058_add_geozone_restricted_to_polls.rb b/db/migrate/20170120161058_add_geozone_restricted_to_polls.rb index d6ed3a2c7..89afbafad 100644 --- a/db/migrate/20170120161058_add_geozone_restricted_to_polls.rb +++ b/db/migrate/20170120161058_add_geozone_restricted_to_polls.rb @@ -1,4 +1,4 @@ -class AddGeozoneRestrictedToPolls < ActiveRecord::Migration +class AddGeozoneRestrictedToPolls < ActiveRecord::Migration[4.2] def change add_column :polls, :geozone_restricted, :boolean, default: false, index: true end diff --git a/db/migrate/20170120164547_remove_all_geozones_from_poll_questions.rb b/db/migrate/20170120164547_remove_all_geozones_from_poll_questions.rb index b4fcecd20..23b67133c 100644 --- a/db/migrate/20170120164547_remove_all_geozones_from_poll_questions.rb +++ b/db/migrate/20170120164547_remove_all_geozones_from_poll_questions.rb @@ -1,4 +1,4 @@ -class RemoveAllGeozonesFromPollQuestions < ActiveRecord::Migration +class RemoveAllGeozonesFromPollQuestions < ActiveRecord::Migration[4.2] def change remove_column :poll_questions, :all_geozones, :boolean end diff --git a/db/migrate/20170125093101_add_ranges_fields_to_legislation_annotations.rb b/db/migrate/20170125093101_add_ranges_fields_to_legislation_annotations.rb index 69ae9df65..1347a681b 100644 --- a/db/migrate/20170125093101_add_ranges_fields_to_legislation_annotations.rb +++ b/db/migrate/20170125093101_add_ranges_fields_to_legislation_annotations.rb @@ -1,4 +1,4 @@ -class AddRangesFieldsToLegislationAnnotations < ActiveRecord::Migration +class AddRangesFieldsToLegislationAnnotations < ActiveRecord::Migration[4.2] def change add_column :legislation_annotations, :range_start, :string add_column :legislation_annotations, :range_start_offset, :integer diff --git a/db/migrate/20170125104542_add_poll_id_and_stats_fields_to_poll_voter.rb b/db/migrate/20170125104542_add_poll_id_and_stats_fields_to_poll_voter.rb index 84e7de5d9..6488f099e 100644 --- a/db/migrate/20170125104542_add_poll_id_and_stats_fields_to_poll_voter.rb +++ b/db/migrate/20170125104542_add_poll_id_and_stats_fields_to_poll_voter.rb @@ -1,4 +1,4 @@ -class AddPollIdAndStatsFieldsToPollVoter < ActiveRecord::Migration +class AddPollIdAndStatsFieldsToPollVoter < ActiveRecord::Migration[4.2] def change add_column :poll_voters, :poll_id, :integer, null: false diff --git a/db/migrate/20170125112017_create_poll_answers.rb b/db/migrate/20170125112017_create_poll_answers.rb index 7ea930d0c..7bd585de3 100644 --- a/db/migrate/20170125112017_create_poll_answers.rb +++ b/db/migrate/20170125112017_create_poll_answers.rb @@ -1,4 +1,4 @@ -class CreatePollAnswers < ActiveRecord::Migration +class CreatePollAnswers < ActiveRecord::Migration[4.2] def change create_table :poll_answers do |t| t.integer :question_id diff --git a/db/migrate/20170125114952_add_answer_id_to_poll_voters.rb b/db/migrate/20170125114952_add_answer_id_to_poll_voters.rb index 34d5bbc54..58d8fabc9 100644 --- a/db/migrate/20170125114952_add_answer_id_to_poll_voters.rb +++ b/db/migrate/20170125114952_add_answer_id_to_poll_voters.rb @@ -1,4 +1,4 @@ -class AddAnswerIdToPollVoters < ActiveRecord::Migration +class AddAnswerIdToPollVoters < ActiveRecord::Migration[4.2] def change add_column :poll_voters, :answer_id, :integer, default: nil diff --git a/db/migrate/20170127173553_add_officer_assignment_to_votes.rb b/db/migrate/20170127173553_add_officer_assignment_to_votes.rb index 1942ef08f..18af88d83 100644 --- a/db/migrate/20170127173553_add_officer_assignment_to_votes.rb +++ b/db/migrate/20170127173553_add_officer_assignment_to_votes.rb @@ -1,4 +1,4 @@ -class AddOfficerAssignmentToVotes < ActiveRecord::Migration +class AddOfficerAssignmentToVotes < ActiveRecord::Migration[4.2] def change add_column :poll_voters, :officer_assignment_id, :integer, default: nil end diff --git a/db/migrate/20170128214244_adds_user_id_to_poll_voters.rb b/db/migrate/20170128214244_adds_user_id_to_poll_voters.rb index edf635cfc..67f81261f 100644 --- a/db/migrate/20170128214244_adds_user_id_to_poll_voters.rb +++ b/db/migrate/20170128214244_adds_user_id_to_poll_voters.rb @@ -1,4 +1,4 @@ -class AddsUserIdToPollVoters < ActiveRecord::Migration +class AddsUserIdToPollVoters < ActiveRecord::Migration[4.2] def change add_reference :poll_voters, :user, index: true end diff --git a/db/migrate/20170130101121_create_poll_final_recount.rb b/db/migrate/20170130101121_create_poll_final_recount.rb index 07723b708..50393cf55 100644 --- a/db/migrate/20170130101121_create_poll_final_recount.rb +++ b/db/migrate/20170130101121_create_poll_final_recount.rb @@ -1,4 +1,4 @@ -class CreatePollFinalRecount < ActiveRecord::Migration +class CreatePollFinalRecount < ActiveRecord::Migration[4.2] def change create_table :poll_final_recounts do |t| t.integer :booth_assignment_id diff --git a/db/migrate/20170130103550_add_final_to_poll_officer_assignments.rb b/db/migrate/20170130103550_add_final_to_poll_officer_assignments.rb index 4cafb5ffb..3b9c2aa91 100644 --- a/db/migrate/20170130103550_add_final_to_poll_officer_assignments.rb +++ b/db/migrate/20170130103550_add_final_to_poll_officer_assignments.rb @@ -1,4 +1,4 @@ -class AddFinalToPollOfficerAssignments < ActiveRecord::Migration +class AddFinalToPollOfficerAssignments < ActiveRecord::Migration[4.2] def change add_column :poll_officer_assignments, :final, :boolean, default: false end diff --git a/db/migrate/20170130133736_add_date_to_final_recount.rb b/db/migrate/20170130133736_add_date_to_final_recount.rb index 14d0f564c..f4f9756f6 100644 --- a/db/migrate/20170130133736_add_date_to_final_recount.rb +++ b/db/migrate/20170130133736_add_date_to_final_recount.rb @@ -1,4 +1,4 @@ -class AddDateToFinalRecount < ActiveRecord::Migration +class AddDateToFinalRecount < ActiveRecord::Migration[4.2] def change add_column :poll_final_recounts, :date, :datetime, null: false end diff --git a/db/migrate/20170130163030_change_datetimes_to_date_in_recounts_and_assignments.rb b/db/migrate/20170130163030_change_datetimes_to_date_in_recounts_and_assignments.rb index 2ef6d0d5a..08ddfc765 100644 --- a/db/migrate/20170130163030_change_datetimes_to_date_in_recounts_and_assignments.rb +++ b/db/migrate/20170130163030_change_datetimes_to_date_in_recounts_and_assignments.rb @@ -1,4 +1,4 @@ -class ChangeDatetimesToDateInRecountsAndAssignments < ActiveRecord::Migration +class ChangeDatetimesToDateInRecountsAndAssignments < ActiveRecord::Migration[4.2] def up change_column :poll_recounts, :date, :date, null: false change_column :poll_final_recounts, :date, :date, null: false diff --git a/db/migrate/20170130171322_remove_summary_from_poll_question.rb b/db/migrate/20170130171322_remove_summary_from_poll_question.rb index 02c5fb68e..8c72b356d 100644 --- a/db/migrate/20170130171322_remove_summary_from_poll_question.rb +++ b/db/migrate/20170130171322_remove_summary_from_poll_question.rb @@ -1,4 +1,4 @@ -class RemoveSummaryFromPollQuestion < ActiveRecord::Migration +class RemoveSummaryFromPollQuestion < ActiveRecord::Migration[4.2] def change remove_column :poll_questions, :summary end diff --git a/db/migrate/20170201113206_adds_fields_to_poll_partial_results.rb b/db/migrate/20170201113206_adds_fields_to_poll_partial_results.rb index 3755dc700..76ff198cd 100644 --- a/db/migrate/20170201113206_adds_fields_to_poll_partial_results.rb +++ b/db/migrate/20170201113206_adds_fields_to_poll_partial_results.rb @@ -1,4 +1,4 @@ -class AddsFieldsToPollPartialResults < ActiveRecord::Migration +class AddsFieldsToPollPartialResults < ActiveRecord::Migration[4.2] def change add_column :poll_partial_results, :date, :date add_column :poll_partial_results, :booth_assignment_id, :integer diff --git a/db/migrate/20170202151151_add_log_fields_to_poll_partial_results.rb b/db/migrate/20170202151151_add_log_fields_to_poll_partial_results.rb index 86966aed4..3038274c5 100644 --- a/db/migrate/20170202151151_add_log_fields_to_poll_partial_results.rb +++ b/db/migrate/20170202151151_add_log_fields_to_poll_partial_results.rb @@ -1,4 +1,4 @@ -class AddLogFieldsToPollPartialResults < ActiveRecord::Migration +class AddLogFieldsToPollPartialResults < ActiveRecord::Migration[4.2] def change add_column :poll_partial_results, :amount_log, :text, default: "" add_column :poll_partial_results, :officer_assignment_id_log, :text, default: "" diff --git a/db/migrate/20170203163304_create_poll_white_results.rb b/db/migrate/20170203163304_create_poll_white_results.rb index 2ebfc93b1..7fc178a22 100644 --- a/db/migrate/20170203163304_create_poll_white_results.rb +++ b/db/migrate/20170203163304_create_poll_white_results.rb @@ -1,4 +1,4 @@ -class CreatePollWhiteResults < ActiveRecord::Migration +class CreatePollWhiteResults < ActiveRecord::Migration[4.2] def change create_table :poll_white_results do |t| t.integer :author_id diff --git a/db/migrate/20170203163317_create_poll_null_results.rb b/db/migrate/20170203163317_create_poll_null_results.rb index 9c138cf65..e11627bef 100644 --- a/db/migrate/20170203163317_create_poll_null_results.rb +++ b/db/migrate/20170203163317_create_poll_null_results.rb @@ -1,4 +1,4 @@ -class CreatePollNullResults < ActiveRecord::Migration +class CreatePollNullResults < ActiveRecord::Migration[4.2] def change create_table :poll_null_results do |t| t.integer :author_id diff --git a/db/migrate/20170208110146_add_officer_id_to_failed_census_calls.rb b/db/migrate/20170208110146_add_officer_id_to_failed_census_calls.rb index 6ce289bec..a7c73528b 100644 --- a/db/migrate/20170208110146_add_officer_id_to_failed_census_calls.rb +++ b/db/migrate/20170208110146_add_officer_id_to_failed_census_calls.rb @@ -1,4 +1,4 @@ -class AddOfficerIdToFailedCensusCalls < ActiveRecord::Migration +class AddOfficerIdToFailedCensusCalls < ActiveRecord::Migration[4.2] def change add_column :failed_census_calls, :poll_officer_id, :integer, index: true add_foreign_key :failed_census_calls, :poll_officers diff --git a/db/migrate/20170208111639_add_failed_census_calls_count_to_poll_officers.rb b/db/migrate/20170208111639_add_failed_census_calls_count_to_poll_officers.rb index 664c51749..c88b0d959 100644 --- a/db/migrate/20170208111639_add_failed_census_calls_count_to_poll_officers.rb +++ b/db/migrate/20170208111639_add_failed_census_calls_count_to_poll_officers.rb @@ -1,4 +1,4 @@ -class AddFailedCensusCallsCountToPollOfficers < ActiveRecord::Migration +class AddFailedCensusCallsCountToPollOfficers < ActiveRecord::Migration[4.2] def change add_column :poll_officers, :failed_census_calls_count, :integer, default: 0 end diff --git a/db/migrate/20170208112814_add_year_of_birth_to_failed_census_calls.rb b/db/migrate/20170208112814_add_year_of_birth_to_failed_census_calls.rb index a3fb5c96a..79f8deed4 100644 --- a/db/migrate/20170208112814_add_year_of_birth_to_failed_census_calls.rb +++ b/db/migrate/20170208112814_add_year_of_birth_to_failed_census_calls.rb @@ -1,4 +1,4 @@ -class AddYearOfBirthToFailedCensusCalls < ActiveRecord::Migration +class AddYearOfBirthToFailedCensusCalls < ActiveRecord::Migration[4.2] def change add_column :failed_census_calls, :year_of_birth, :integer end diff --git a/db/migrate/20170208114548_add_user_data_log_to_poll_officer_assignments.rb b/db/migrate/20170208114548_add_user_data_log_to_poll_officer_assignments.rb index 93c2efd8b..b09e75a81 100644 --- a/db/migrate/20170208114548_add_user_data_log_to_poll_officer_assignments.rb +++ b/db/migrate/20170208114548_add_user_data_log_to_poll_officer_assignments.rb @@ -1,4 +1,4 @@ -class AddUserDataLogToPollOfficerAssignments < ActiveRecord::Migration +class AddUserDataLogToPollOfficerAssignments < ActiveRecord::Migration[4.2] def change add_column :poll_officer_assignments, :user_data_log, :string, default: "" end diff --git a/db/migrate/20170208160130_add_former_users_data_log_to_users.rb b/db/migrate/20170208160130_add_former_users_data_log_to_users.rb index 2cd3ca956..05b4ac66e 100644 --- a/db/migrate/20170208160130_add_former_users_data_log_to_users.rb +++ b/db/migrate/20170208160130_add_former_users_data_log_to_users.rb @@ -1,4 +1,4 @@ -class AddFormerUsersDataLogToUsers < ActiveRecord::Migration +class AddFormerUsersDataLogToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :former_users_data_log, :text, default: "" end diff --git a/db/migrate/20170210083026_add_context_for_legislation_annotations.rb b/db/migrate/20170210083026_add_context_for_legislation_annotations.rb index 8bf19a64c..91166b571 100644 --- a/db/migrate/20170210083026_add_context_for_legislation_annotations.rb +++ b/db/migrate/20170210083026_add_context_for_legislation_annotations.rb @@ -1,4 +1,4 @@ -class AddContextForLegislationAnnotations < ActiveRecord::Migration +class AddContextForLegislationAnnotations < ActiveRecord::Migration[4.2] def change add_column :legislation_annotations, :context, :text end diff --git a/db/migrate/20170212123435_add_polls_related_indexes.rb b/db/migrate/20170212123435_add_polls_related_indexes.rb index f1a667432..31f567e89 100644 --- a/db/migrate/20170212123435_add_polls_related_indexes.rb +++ b/db/migrate/20170212123435_add_polls_related_indexes.rb @@ -1,4 +1,4 @@ -class AddPollsRelatedIndexes < ActiveRecord::Migration +class AddPollsRelatedIndexes < ActiveRecord::Migration[4.2] def change add_index :poll_booth_assignments, :booth_id diff --git a/db/migrate/20170316174351_create_site_customization_pages.rb b/db/migrate/20170316174351_create_site_customization_pages.rb index 3c4fbe846..8489c8263 100644 --- a/db/migrate/20170316174351_create_site_customization_pages.rb +++ b/db/migrate/20170316174351_create_site_customization_pages.rb @@ -1,4 +1,4 @@ -class CreateSiteCustomizationPages < ActiveRecord::Migration +class CreateSiteCustomizationPages < ActiveRecord::Migration[4.2] def change create_table :site_customization_pages do |t| t.string :slug, null: false diff --git a/db/migrate/20170322145702_create_site_customization_images.rb b/db/migrate/20170322145702_create_site_customization_images.rb index 4f980b566..749601f46 100644 --- a/db/migrate/20170322145702_create_site_customization_images.rb +++ b/db/migrate/20170322145702_create_site_customization_images.rb @@ -1,4 +1,4 @@ -class CreateSiteCustomizationImages < ActiveRecord::Migration +class CreateSiteCustomizationImages < ActiveRecord::Migration[4.2] def change create_table :site_customization_images do |t| t.string :name, null: false diff --git a/db/migrate/20170324101716_create_site_customization_content_blocks.rb b/db/migrate/20170324101716_create_site_customization_content_blocks.rb index d0e4c3822..a8ba36284 100644 --- a/db/migrate/20170324101716_create_site_customization_content_blocks.rb +++ b/db/migrate/20170324101716_create_site_customization_content_blocks.rb @@ -1,4 +1,4 @@ -class CreateSiteCustomizationContentBlocks < ActiveRecord::Migration +class CreateSiteCustomizationContentBlocks < ActiveRecord::Migration[4.2] def change create_table :site_customization_content_blocks do |t| t.string :name diff --git a/db/migrate/20170427145845_change_budget_name.rb b/db/migrate/20170427145845_change_budget_name.rb index cbf5e12db..9f371a797 100644 --- a/db/migrate/20170427145845_change_budget_name.rb +++ b/db/migrate/20170427145845_change_budget_name.rb @@ -1,4 +1,4 @@ -class ChangeBudgetName < ActiveRecord::Migration +class ChangeBudgetName < ActiveRecord::Migration[4.2] def up change_column :budgets, :name, :string, limit: 80 end diff --git a/db/migrate/20170428111355_add_ballot_line_count_to_investments.rb b/db/migrate/20170428111355_add_ballot_line_count_to_investments.rb index a864075a8..6df6d2ecf 100644 --- a/db/migrate/20170428111355_add_ballot_line_count_to_investments.rb +++ b/db/migrate/20170428111355_add_ballot_line_count_to_investments.rb @@ -1,4 +1,4 @@ -class AddBallotLineCountToInvestments < ActiveRecord::Migration +class AddBallotLineCountToInvestments < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :ballot_lines_count, :integer, default: 0 end diff --git a/db/migrate/20170503163330_add_uniq_index_for_ballot_lines.rb b/db/migrate/20170503163330_add_uniq_index_for_ballot_lines.rb index dec90f329..de49e4f2d 100644 --- a/db/migrate/20170503163330_add_uniq_index_for_ballot_lines.rb +++ b/db/migrate/20170503163330_add_uniq_index_for_ballot_lines.rb @@ -1,4 +1,4 @@ -class AddUniqIndexForBallotLines < ActiveRecord::Migration +class AddUniqIndexForBallotLines < ActiveRecord::Migration[4.2] def change add_index :budget_ballot_lines, [:ballot_id, :investment_id], unique: true end diff --git a/db/migrate/20170513110025_add_previous_heading_id_to_investments.rb b/db/migrate/20170513110025_add_previous_heading_id_to_investments.rb index 878799712..be1eea5ab 100644 --- a/db/migrate/20170513110025_add_previous_heading_id_to_investments.rb +++ b/db/migrate/20170513110025_add_previous_heading_id_to_investments.rb @@ -1,4 +1,4 @@ -class AddPreviousHeadingIdToInvestments < ActiveRecord::Migration +class AddPreviousHeadingIdToInvestments < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :previous_heading_id, :integer end diff --git a/db/migrate/20170517123042_create_budget_reclassified_votes.rb b/db/migrate/20170517123042_create_budget_reclassified_votes.rb index 27cf531d3..10d5d8127 100644 --- a/db/migrate/20170517123042_create_budget_reclassified_votes.rb +++ b/db/migrate/20170517123042_create_budget_reclassified_votes.rb @@ -1,4 +1,4 @@ -class CreateBudgetReclassifiedVotes < ActiveRecord::Migration +class CreateBudgetReclassifiedVotes < ActiveRecord::Migration[4.2] def change create_table :budget_reclassified_votes do |t| t.integer :user_id diff --git a/db/migrate/20170519084239_add_winner_to_budget_investments.rb b/db/migrate/20170519084239_add_winner_to_budget_investments.rb index af6085468..32f33d22a 100644 --- a/db/migrate/20170519084239_add_winner_to_budget_investments.rb +++ b/db/migrate/20170519084239_add_winner_to_budget_investments.rb @@ -1,4 +1,4 @@ -class AddWinnerToBudgetInvestments < ActiveRecord::Migration +class AddWinnerToBudgetInvestments < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :winner, :boolean, default: false end diff --git a/db/migrate/20170602162155_add_summary_to_legislative_process.rb b/db/migrate/20170602162155_add_summary_to_legislative_process.rb index 7ac9d2255..d118528ad 100644 --- a/db/migrate/20170602162155_add_summary_to_legislative_process.rb +++ b/db/migrate/20170602162155_add_summary_to_legislative_process.rb @@ -1,4 +1,4 @@ -class AddSummaryToLegislativeProcess < ActiveRecord::Migration +class AddSummaryToLegislativeProcess < ActiveRecord::Migration[4.2] def change add_column :legislation_processes, :summary, :text, limit: 280 end diff --git a/db/migrate/20170610211027_remove_ht_participate_and_target_from_leg_process.rb b/db/migrate/20170610211027_remove_ht_participate_and_target_from_leg_process.rb index f7fbda32c..065b608b0 100644 --- a/db/migrate/20170610211027_remove_ht_participate_and_target_from_leg_process.rb +++ b/db/migrate/20170610211027_remove_ht_participate_and_target_from_leg_process.rb @@ -1,4 +1,4 @@ -class RemoveHtParticipateAndTargetFromLegProcess < ActiveRecord::Migration +class RemoveHtParticipateAndTargetFromLegProcess < ActiveRecord::Migration[4.2] def change remove_column :legislation_processes, :how_to_participate, :text remove_column :legislation_processes, :target, :text diff --git a/db/migrate/20170613174317_rename_legislation_process_final_pub_to_result_pub.rb b/db/migrate/20170613174317_rename_legislation_process_final_pub_to_result_pub.rb index e71314531..81690e517 100644 --- a/db/migrate/20170613174317_rename_legislation_process_final_pub_to_result_pub.rb +++ b/db/migrate/20170613174317_rename_legislation_process_final_pub_to_result_pub.rb @@ -1,4 +1,4 @@ -class RenameLegislationProcessFinalPubToResultPub < ActiveRecord::Migration +class RenameLegislationProcessFinalPubToResultPub < ActiveRecord::Migration[4.2] def change rename_column :legislation_processes, :final_publication_date, :result_publication_date end diff --git a/db/migrate/20170613203256_add_phase_pub_enabled_status_to_legislative_process.rb b/db/migrate/20170613203256_add_phase_pub_enabled_status_to_legislative_process.rb index 7e6ecda96..b331f65f9 100644 --- a/db/migrate/20170613203256_add_phase_pub_enabled_status_to_legislative_process.rb +++ b/db/migrate/20170613203256_add_phase_pub_enabled_status_to_legislative_process.rb @@ -1,4 +1,4 @@ -class AddPhasePubEnabledStatusToLegislativeProcess < ActiveRecord::Migration +class AddPhasePubEnabledStatusToLegislativeProcess < ActiveRecord::Migration[4.2] def change add_column :legislation_processes, :debate_phase_enabled, :boolean, default: false add_column :legislation_processes, :allegations_phase_enabled, :boolean, default: false diff --git a/db/migrate/20170620132731_create_budget_investment_milestones.rb b/db/migrate/20170620132731_create_budget_investment_milestones.rb index 199d8e70e..669417334 100644 --- a/db/migrate/20170620132731_create_budget_investment_milestones.rb +++ b/db/migrate/20170620132731_create_budget_investment_milestones.rb @@ -1,4 +1,4 @@ -class CreateBudgetInvestmentMilestones < ActiveRecord::Migration +class CreateBudgetInvestmentMilestones < ActiveRecord::Migration[4.2] def change create_table :budget_investment_milestones do |t| t.integer :investment_id diff --git a/db/migrate/20170621180611_add_population_to_budget_headings.rb b/db/migrate/20170621180611_add_population_to_budget_headings.rb index fe723bc98..6125a2c5f 100644 --- a/db/migrate/20170621180611_add_population_to_budget_headings.rb +++ b/db/migrate/20170621180611_add_population_to_budget_headings.rb @@ -1,4 +1,4 @@ -class AddPopulationToBudgetHeadings < ActiveRecord::Migration +class AddPopulationToBudgetHeadings < ActiveRecord::Migration[4.2] def change add_column :budget_headings, :population, :integer, default: nil end diff --git a/db/migrate/20170623141655_remove_featured_from_tags.rb b/db/migrate/20170623141655_remove_featured_from_tags.rb index a819cf553..ac8472e4e 100644 --- a/db/migrate/20170623141655_remove_featured_from_tags.rb +++ b/db/migrate/20170623141655_remove_featured_from_tags.rb @@ -1,4 +1,4 @@ -class RemoveFeaturedFromTags < ActiveRecord::Migration +class RemoveFeaturedFromTags < ActiveRecord::Migration[4.2] def change remove_column :tags, :featured, :boolean, default: false end diff --git a/db/migrate/20170626081337_add_published_to_legislation_processes.rb b/db/migrate/20170626081337_add_published_to_legislation_processes.rb index abb03f2f8..5b36994ba 100644 --- a/db/migrate/20170626081337_add_published_to_legislation_processes.rb +++ b/db/migrate/20170626081337_add_published_to_legislation_processes.rb @@ -1,4 +1,4 @@ -class AddPublishedToLegislationProcesses < ActiveRecord::Migration +class AddPublishedToLegislationProcesses < ActiveRecord::Migration[4.2] def change add_column :legislation_processes, :published, :boolean, default: true end diff --git a/db/migrate/20170626180127_create_follows.rb b/db/migrate/20170626180127_create_follows.rb index d4225cab8..af9da19bf 100644 --- a/db/migrate/20170626180127_create_follows.rb +++ b/db/migrate/20170626180127_create_follows.rb @@ -1,4 +1,4 @@ -class CreateFollows < ActiveRecord::Migration +class CreateFollows < ActiveRecord::Migration[4.2] def change create_table :follows do |t| t.references :user, index: true, foreign_key: true diff --git a/db/migrate/20170627113331_create_images.rb b/db/migrate/20170627113331_create_images.rb index 66567845a..e82e3cd14 100644 --- a/db/migrate/20170627113331_create_images.rb +++ b/db/migrate/20170627113331_create_images.rb @@ -1,4 +1,4 @@ -class CreateImages < ActiveRecord::Migration +class CreateImages < ActiveRecord::Migration[4.2] def up create_table :images do |t| t.references :imageable, polymorphic: true, index: true diff --git a/db/migrate/20170630105250_add_public_interests_to_user.rb b/db/migrate/20170630105250_add_public_interests_to_user.rb index 8fec4a748..3c13ea320 100644 --- a/db/migrate/20170630105250_add_public_interests_to_user.rb +++ b/db/migrate/20170630105250_add_public_interests_to_user.rb @@ -1,4 +1,4 @@ -class AddPublicInterestsToUser < ActiveRecord::Migration +class AddPublicInterestsToUser < ActiveRecord::Migration[4.2] def change add_column :users, :public_interests, :boolean, default: false end diff --git a/db/migrate/20170702105956_add_locale_to_site_customization_pages.rb b/db/migrate/20170702105956_add_locale_to_site_customization_pages.rb index 2675d9fa7..dea4a9549 100644 --- a/db/migrate/20170702105956_add_locale_to_site_customization_pages.rb +++ b/db/migrate/20170702105956_add_locale_to_site_customization_pages.rb @@ -1,4 +1,4 @@ -class AddLocaleToSiteCustomizationPages < ActiveRecord::Migration +class AddLocaleToSiteCustomizationPages < ActiveRecord::Migration[4.2] def change add_column :site_customization_pages, :locale, :string end diff --git a/db/migrate/20170703120055_add_incompatible_to_budget_investments.rb b/db/migrate/20170703120055_add_incompatible_to_budget_investments.rb index 2fffc0802..64fc1dc56 100644 --- a/db/migrate/20170703120055_add_incompatible_to_budget_investments.rb +++ b/db/migrate/20170703120055_add_incompatible_to_budget_investments.rb @@ -1,4 +1,4 @@ -class AddIncompatibleToBudgetInvestments < ActiveRecord::Migration +class AddIncompatibleToBudgetInvestments < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :incompatible, :bool, default: false, index: true end diff --git a/db/migrate/20170704105112_add_slugs_to_budget_heading_group.rb b/db/migrate/20170704105112_add_slugs_to_budget_heading_group.rb index 85c94e66f..1df0ee7c8 100644 --- a/db/migrate/20170704105112_add_slugs_to_budget_heading_group.rb +++ b/db/migrate/20170704105112_add_slugs_to_budget_heading_group.rb @@ -1,4 +1,4 @@ -class AddSlugsToBudgetHeadingGroup < ActiveRecord::Migration +class AddSlugsToBudgetHeadingGroup < ActiveRecord::Migration[4.2] def change add_column :budgets, :slug, :string add_column :budget_groups, :slug, :string diff --git a/db/migrate/20170708174932_create_local_census_records.rb b/db/migrate/20170708174932_create_local_census_records.rb index 640594ded..9603194e4 100644 --- a/db/migrate/20170708174932_create_local_census_records.rb +++ b/db/migrate/20170708174932_create_local_census_records.rb @@ -1,4 +1,4 @@ -class CreateLocalCensusRecords < ActiveRecord::Migration +class CreateLocalCensusRecords < ActiveRecord::Migration[4.2] def change create_table :local_census_records do |t| t.string :document_number, null: false diff --git a/db/migrate/20170708225159_remove_tolk.rb b/db/migrate/20170708225159_remove_tolk.rb index d07c88ebb..8f9e08820 100644 --- a/db/migrate/20170708225159_remove_tolk.rb +++ b/db/migrate/20170708225159_remove_tolk.rb @@ -1,4 +1,4 @@ -class RemoveTolk < ActiveRecord::Migration +class RemoveTolk < ActiveRecord::Migration[4.2] def change remove_index :tolk_translations, column: [:phrase_id, :locale_id] remove_index :tolk_locales, column: :name diff --git a/db/migrate/20170713110317_remove_local_census_record_user_id.rb b/db/migrate/20170713110317_remove_local_census_record_user_id.rb index 9285d849e..7833a806f 100644 --- a/db/migrate/20170713110317_remove_local_census_record_user_id.rb +++ b/db/migrate/20170713110317_remove_local_census_record_user_id.rb @@ -1,4 +1,4 @@ -class RemoveLocalCensusRecordUserId < ActiveRecord::Migration +class RemoveLocalCensusRecordUserId < ActiveRecord::Migration[4.2] def change remove_column :local_census_records, :user_id end diff --git a/db/migrate/20170719174326_remove_poll_recount.rb b/db/migrate/20170719174326_remove_poll_recount.rb index 67720ff91..2378f16c3 100644 --- a/db/migrate/20170719174326_remove_poll_recount.rb +++ b/db/migrate/20170719174326_remove_poll_recount.rb @@ -1,4 +1,4 @@ -class RemovePollRecount < ActiveRecord::Migration +class RemovePollRecount < ActiveRecord::Migration[4.2] def change remove_index :poll_recounts, column: [:booth_assignment_id] remove_index :poll_recounts, column: [:officer_assignment_id] diff --git a/db/migrate/20170720092638_create_documents.rb b/db/migrate/20170720092638_create_documents.rb index b7d1e287c..429487def 100644 --- a/db/migrate/20170720092638_create_documents.rb +++ b/db/migrate/20170720092638_create_documents.rb @@ -1,4 +1,4 @@ -class CreateDocuments < ActiveRecord::Migration +class CreateDocuments < ActiveRecord::Migration[4.2] def change create_table :documents do |t| t.string :title diff --git a/db/migrate/20170724190805_create_poll_shifts.rb b/db/migrate/20170724190805_create_poll_shifts.rb index 8bb6eafd7..3b5f36cf1 100644 --- a/db/migrate/20170724190805_create_poll_shifts.rb +++ b/db/migrate/20170724190805_create_poll_shifts.rb @@ -1,4 +1,4 @@ -class CreatePollShifts < ActiveRecord::Migration +class CreatePollShifts < ActiveRecord::Migration[4.2] def change create_table :poll_shifts do |t| t.integer :booth_id diff --git a/db/migrate/20170804170049_create_community.rb b/db/migrate/20170804170049_create_community.rb index 938b75efb..ba1268db4 100644 --- a/db/migrate/20170804170049_create_community.rb +++ b/db/migrate/20170804170049_create_community.rb @@ -1,4 +1,4 @@ -class CreateCommunity < ActiveRecord::Migration +class CreateCommunity < ActiveRecord::Migration[4.2] def change create_table :communities do |t| t.timestamps null: false diff --git a/db/migrate/20170804171325_add_community_to_proposal.rb b/db/migrate/20170804171325_add_community_to_proposal.rb index e18cd53c9..9b36c331b 100644 --- a/db/migrate/20170804171325_add_community_to_proposal.rb +++ b/db/migrate/20170804171325_add_community_to_proposal.rb @@ -1,4 +1,4 @@ -class AddCommunityToProposal < ActiveRecord::Migration +class AddCommunityToProposal < ActiveRecord::Migration[4.2] def change add_reference :proposals, :community, index: true, foreign_key: true end diff --git a/db/migrate/20170805132736_create_map_locations.rb b/db/migrate/20170805132736_create_map_locations.rb index a75820d54..ed6c8d1bf 100644 --- a/db/migrate/20170805132736_create_map_locations.rb +++ b/db/migrate/20170805132736_create_map_locations.rb @@ -1,4 +1,4 @@ -class CreateMapLocations < ActiveRecord::Migration +class CreateMapLocations < ActiveRecord::Migration[4.2] def change create_table :map_locations do |t| t.float :latitude diff --git a/db/migrate/20170807082243_create_topics.rb b/db/migrate/20170807082243_create_topics.rb index 073a65efc..89aeb2789 100644 --- a/db/migrate/20170807082243_create_topics.rb +++ b/db/migrate/20170807082243_create_topics.rb @@ -1,4 +1,4 @@ -class CreateTopics < ActiveRecord::Migration +class CreateTopics < ActiveRecord::Migration[4.2] def change create_table :topics do |t| t.string :title, null: false diff --git a/db/migrate/20170822144743_add_community_to_budget_investments.rb b/db/migrate/20170822144743_add_community_to_budget_investments.rb index 08fefbb63..e345b7c81 100644 --- a/db/migrate/20170822144743_add_community_to_budget_investments.rb +++ b/db/migrate/20170822144743_add_community_to_budget_investments.rb @@ -1,4 +1,4 @@ -class AddCommunityToBudgetInvestments < ActiveRecord::Migration +class AddCommunityToBudgetInvestments < ActiveRecord::Migration[4.2] def change add_reference :budget_investments, :community, index: true, foreign_key: true end diff --git a/db/migrate/20170905111444_add_video_url_to_poll_questions.rb b/db/migrate/20170905111444_add_video_url_to_poll_questions.rb index 800ca915e..1ac94efa2 100644 --- a/db/migrate/20170905111444_add_video_url_to_poll_questions.rb +++ b/db/migrate/20170905111444_add_video_url_to_poll_questions.rb @@ -1,4 +1,4 @@ -class AddVideoUrlToPollQuestions < ActiveRecord::Migration +class AddVideoUrlToPollQuestions < ActiveRecord::Migration[4.2] def change add_column :poll_questions, :video_url, :string end diff --git a/db/migrate/20170908175149_add_officer_data_to_poll_shifts.rb b/db/migrate/20170908175149_add_officer_data_to_poll_shifts.rb index 0982345b4..c28e8dd87 100644 --- a/db/migrate/20170908175149_add_officer_data_to_poll_shifts.rb +++ b/db/migrate/20170908175149_add_officer_data_to_poll_shifts.rb @@ -1,4 +1,4 @@ -class AddOfficerDataToPollShifts < ActiveRecord::Migration +class AddOfficerDataToPollShifts < ActiveRecord::Migration[4.2] def change add_column :poll_shifts, :officer_name, :string add_column :poll_shifts, :officer_email, :string diff --git a/db/migrate/20170911110109_add_user_id_to_images.rb b/db/migrate/20170911110109_add_user_id_to_images.rb index 31467acee..9944da6c5 100644 --- a/db/migrate/20170911110109_add_user_id_to_images.rb +++ b/db/migrate/20170911110109_add_user_id_to_images.rb @@ -1,4 +1,4 @@ -class AddUserIdToImages < ActiveRecord::Migration +class AddUserIdToImages < ActiveRecord::Migration[4.2] def change add_reference :images, :user, index: true, foreign_key: true end diff --git a/db/migrate/20170913101029_add_proposals_phase_to_legislation_processes.rb b/db/migrate/20170913101029_add_proposals_phase_to_legislation_processes.rb index b3ecfe3f1..5c3d385c7 100644 --- a/db/migrate/20170913101029_add_proposals_phase_to_legislation_processes.rb +++ b/db/migrate/20170913101029_add_proposals_phase_to_legislation_processes.rb @@ -1,4 +1,4 @@ -class AddProposalsPhaseToLegislationProcesses < ActiveRecord::Migration +class AddProposalsPhaseToLegislationProcesses < ActiveRecord::Migration[4.2] def change add_column :legislation_processes, :proposals_phase_start_date, :date add_column :legislation_processes, :proposals_phase_end_date, :date diff --git a/db/migrate/20170913130803_add_proposals_description_to_legislation_processes.rb b/db/migrate/20170913130803_add_proposals_description_to_legislation_processes.rb index d5e4f9c5d..1c5549883 100644 --- a/db/migrate/20170913130803_add_proposals_description_to_legislation_processes.rb +++ b/db/migrate/20170913130803_add_proposals_description_to_legislation_processes.rb @@ -1,4 +1,4 @@ -class AddProposalsDescriptionToLegislationProcesses < ActiveRecord::Migration +class AddProposalsDescriptionToLegislationProcesses < ActiveRecord::Migration[4.2] def change add_column :legislation_processes, :proposals_description, :text end diff --git a/db/migrate/20170914102634_create_legislation_proposals.rb b/db/migrate/20170914102634_create_legislation_proposals.rb index defe9f1dd..9a02c6971 100644 --- a/db/migrate/20170914102634_create_legislation_proposals.rb +++ b/db/migrate/20170914102634_create_legislation_proposals.rb @@ -1,4 +1,4 @@ -class CreateLegislationProposals < ActiveRecord::Migration +class CreateLegislationProposals < ActiveRecord::Migration[4.2] def change create_table :legislation_proposals do |t| t.references :legislation_process, index: true, foreign_key: true diff --git a/db/migrate/20170914114427_create_poll_total_results.rb b/db/migrate/20170914114427_create_poll_total_results.rb index 1a733dce4..2b412fd7f 100644 --- a/db/migrate/20170914114427_create_poll_total_results.rb +++ b/db/migrate/20170914114427_create_poll_total_results.rb @@ -1,4 +1,4 @@ -class CreatePollTotalResults < ActiveRecord::Migration +class CreatePollTotalResults < ActiveRecord::Migration[4.2] def change create_table :poll_total_results do |t| t.integer :author_id diff --git a/db/migrate/20170914154743_fix_password_changed_at_default.rb b/db/migrate/20170914154743_fix_password_changed_at_default.rb index dd3eb9aea..4c1fc0107 100644 --- a/db/migrate/20170914154743_fix_password_changed_at_default.rb +++ b/db/migrate/20170914154743_fix_password_changed_at_default.rb @@ -1,4 +1,4 @@ -class FixPasswordChangedAtDefault < ActiveRecord::Migration +class FixPasswordChangedAtDefault < ActiveRecord::Migration[4.2] def up change_column_default :users, :password_changed_at, Time.new(2015, 1, 1, 1, 1, 1) end diff --git a/db/migrate/20170915101519_add_legislation_proposals_count_to_tags.rb b/db/migrate/20170915101519_add_legislation_proposals_count_to_tags.rb index 8c47394a4..750a96841 100644 --- a/db/migrate/20170915101519_add_legislation_proposals_count_to_tags.rb +++ b/db/migrate/20170915101519_add_legislation_proposals_count_to_tags.rb @@ -1,4 +1,4 @@ -class AddLegislationProposalsCountToTags < ActiveRecord::Migration +class AddLegislationProposalsCountToTags < ActiveRecord::Migration[4.2] def change add_column :tags, "legislation/proposals_count", :integer, default: 0 add_index :tags, :"legislation/proposals_count" diff --git a/db/migrate/20170918231410_remove_poll_final_recounts.rb b/db/migrate/20170918231410_remove_poll_final_recounts.rb index 369a959bb..31fc72e90 100644 --- a/db/migrate/20170918231410_remove_poll_final_recounts.rb +++ b/db/migrate/20170918231410_remove_poll_final_recounts.rb @@ -1,4 +1,4 @@ -class RemovePollFinalRecounts < ActiveRecord::Migration +class RemovePollFinalRecounts < ActiveRecord::Migration[4.2] def change remove_index :poll_final_recounts, column: :booth_assignment_id remove_index :poll_final_recounts, column: :officer_assignment_id diff --git a/db/migrate/20170922101247_add_legislation_processes_count_to_tags.rb b/db/migrate/20170922101247_add_legislation_processes_count_to_tags.rb index 4ae67b760..8ce1b2a96 100644 --- a/db/migrate/20170922101247_add_legislation_processes_count_to_tags.rb +++ b/db/migrate/20170922101247_add_legislation_processes_count_to_tags.rb @@ -1,4 +1,4 @@ -class AddLegislationProcessesCountToTags < ActiveRecord::Migration +class AddLegislationProcessesCountToTags < ActiveRecord::Migration[4.2] def change add_column :tags, "legislation/processes_count", :integer, default: 0 add_index :tags, :"legislation/processes_count" diff --git a/db/migrate/20170927110953_add_shift_task.rb b/db/migrate/20170927110953_add_shift_task.rb index 8adf23dd1..e55a980cf 100644 --- a/db/migrate/20170927110953_add_shift_task.rb +++ b/db/migrate/20170927110953_add_shift_task.rb @@ -1,4 +1,4 @@ -class AddShiftTask < ActiveRecord::Migration +class AddShiftTask < ActiveRecord::Migration[4.2] def change add_column :poll_shifts, :task, :integer, null: false, default: 0 end diff --git a/db/migrate/20170928132402_add_summary_and_description_to_polls.rb b/db/migrate/20170928132402_add_summary_and_description_to_polls.rb index 6fb965346..0160e32f9 100644 --- a/db/migrate/20170928132402_add_summary_and_description_to_polls.rb +++ b/db/migrate/20170928132402_add_summary_and_description_to_polls.rb @@ -1,4 +1,4 @@ -class AddSummaryAndDescriptionToPolls < ActiveRecord::Migration +class AddSummaryAndDescriptionToPolls < ActiveRecord::Migration[4.2] def change add_column :polls, :summary, :text add_column :polls, :description, :text diff --git a/db/migrate/20171002103314_add_poll_shift_task_index.rb b/db/migrate/20171002103314_add_poll_shift_task_index.rb index d15275556..3e28def56 100644 --- a/db/migrate/20171002103314_add_poll_shift_task_index.rb +++ b/db/migrate/20171002103314_add_poll_shift_task_index.rb @@ -1,4 +1,4 @@ -class AddPollShiftTaskIndex < ActiveRecord::Migration +class AddPollShiftTaskIndex < ActiveRecord::Migration[4.2] def change remove_index "poll_shifts", name: "index_poll_shifts_on_booth_id_and_officer_id" add_index :poll_shifts, :task diff --git a/db/migrate/20171002121658_add_origin_to_poll_voters.rb b/db/migrate/20171002121658_add_origin_to_poll_voters.rb index 845c1b774..4bf0f38c2 100644 --- a/db/migrate/20171002121658_add_origin_to_poll_voters.rb +++ b/db/migrate/20171002121658_add_origin_to_poll_voters.rb @@ -1,4 +1,4 @@ -class AddOriginToPollVoters < ActiveRecord::Migration +class AddOriginToPollVoters < ActiveRecord::Migration[4.2] def change add_column :poll_voters, :origin, :string end diff --git a/db/migrate/20171002122312_create_poll_recount.rb b/db/migrate/20171002122312_create_poll_recount.rb index 807f1c84e..c104b483f 100644 --- a/db/migrate/20171002122312_create_poll_recount.rb +++ b/db/migrate/20171002122312_create_poll_recount.rb @@ -1,4 +1,4 @@ -class CreatePollRecount < ActiveRecord::Migration +class CreatePollRecount < ActiveRecord::Migration[4.2] def change create_table :poll_recounts do |t| t.integer :author_id diff --git a/db/migrate/20171002133547_remove_poll_white_null_total_results.rb b/db/migrate/20171002133547_remove_poll_white_null_total_results.rb index 5fff82ef3..9d3aa7b14 100644 --- a/db/migrate/20171002133547_remove_poll_white_null_total_results.rb +++ b/db/migrate/20171002133547_remove_poll_white_null_total_results.rb @@ -1,4 +1,4 @@ -class RemovePollWhiteNullTotalResults < ActiveRecord::Migration +class RemovePollWhiteNullTotalResults < ActiveRecord::Migration[4.2] def change remove_index :poll_null_results, column: [:booth_assignment_id] remove_index :poll_null_results, column: [:officer_assignment_id] diff --git a/db/migrate/20171002191347_add_default_to_recount_amounts.rb b/db/migrate/20171002191347_add_default_to_recount_amounts.rb index b90e86aae..32f0ef6b7 100644 --- a/db/migrate/20171002191347_add_default_to_recount_amounts.rb +++ b/db/migrate/20171002191347_add_default_to_recount_amounts.rb @@ -1,4 +1,4 @@ -class AddDefaultToRecountAmounts < ActiveRecord::Migration +class AddDefaultToRecountAmounts < ActiveRecord::Migration[4.2] def change change_column_default :poll_recounts, :white_amount, 0 change_column_default :poll_recounts, :null_amount, 0 diff --git a/db/migrate/20171003095936_remove_officer_assigment_composed_index.rb b/db/migrate/20171003095936_remove_officer_assigment_composed_index.rb index 874672f84..62e4d12cf 100644 --- a/db/migrate/20171003095936_remove_officer_assigment_composed_index.rb +++ b/db/migrate/20171003095936_remove_officer_assigment_composed_index.rb @@ -1,4 +1,4 @@ -class RemoveOfficerAssigmentComposedIndex < ActiveRecord::Migration +class RemoveOfficerAssigmentComposedIndex < ActiveRecord::Migration[4.2] def change remove_index "poll_officer_assignments", name: "index_poll_officer_assignments_on_officer_id_and_date" end diff --git a/db/migrate/20171003143034_add_comments_count_to_polls.rb b/db/migrate/20171003143034_add_comments_count_to_polls.rb index 675acae3f..cd372db2b 100644 --- a/db/migrate/20171003143034_add_comments_count_to_polls.rb +++ b/db/migrate/20171003143034_add_comments_count_to_polls.rb @@ -1,4 +1,4 @@ -class AddCommentsCountToPolls < ActiveRecord::Migration +class AddCommentsCountToPolls < ActiveRecord::Migration[4.2] def change add_column :polls, :comments_count, :integer, default: 0 add_column :polls, :author_id, :integer diff --git a/db/migrate/20171003170029_remove_description_from_poll_questions.rb b/db/migrate/20171003170029_remove_description_from_poll_questions.rb index 31e1b9578..36f3483aa 100644 --- a/db/migrate/20171003170029_remove_description_from_poll_questions.rb +++ b/db/migrate/20171003170029_remove_description_from_poll_questions.rb @@ -1,4 +1,4 @@ -class RemoveDescriptionFromPollQuestions < ActiveRecord::Migration +class RemoveDescriptionFromPollQuestions < ActiveRecord::Migration[4.2] def change remove_column :poll_questions, :description end diff --git a/db/migrate/20171003212958_add_date_to_poll_shift_composed_index.rb b/db/migrate/20171003212958_add_date_to_poll_shift_composed_index.rb index b59a859c1..28c7e51ac 100644 --- a/db/migrate/20171003212958_add_date_to_poll_shift_composed_index.rb +++ b/db/migrate/20171003212958_add_date_to_poll_shift_composed_index.rb @@ -1,4 +1,4 @@ -class AddDateToPollShiftComposedIndex < ActiveRecord::Migration +class AddDateToPollShiftComposedIndex < ActiveRecord::Migration[4.2] def change remove_index "poll_shifts", name: "index_poll_shifts_on_booth_id_and_officer_id_and_task" remove_index "poll_shifts", name: "index_poll_shifts_on_task" diff --git a/db/migrate/20171003223152_add_officer_to_poll_voter.rb b/db/migrate/20171003223152_add_officer_to_poll_voter.rb index 99f9cd3e3..b2adeb6c5 100644 --- a/db/migrate/20171003223152_add_officer_to_poll_voter.rb +++ b/db/migrate/20171003223152_add_officer_to_poll_voter.rb @@ -1,4 +1,4 @@ -class AddOfficerToPollVoter < ActiveRecord::Migration +class AddOfficerToPollVoter < ActiveRecord::Migration[4.2] def change add_column :poll_voters, :officer_id, :integer end diff --git a/db/migrate/20171004025903_create_poll_question_answers.rb b/db/migrate/20171004025903_create_poll_question_answers.rb index 834421f5f..488890599 100644 --- a/db/migrate/20171004025903_create_poll_question_answers.rb +++ b/db/migrate/20171004025903_create_poll_question_answers.rb @@ -1,4 +1,4 @@ -class CreatePollQuestionAnswers < ActiveRecord::Migration +class CreatePollQuestionAnswers < ActiveRecord::Migration[4.2] def change create_table :poll_question_answers do |t| t.string :title diff --git a/db/migrate/20171004151553_rename_poll_question_id_to_question_id.rb b/db/migrate/20171004151553_rename_poll_question_id_to_question_id.rb index c53298bfb..abbdb8a6b 100644 --- a/db/migrate/20171004151553_rename_poll_question_id_to_question_id.rb +++ b/db/migrate/20171004151553_rename_poll_question_id_to_question_id.rb @@ -1,4 +1,4 @@ -class RenamePollQuestionIdToQuestionId < ActiveRecord::Migration +class RenamePollQuestionIdToQuestionId < ActiveRecord::Migration[4.2] def change rename_column :poll_question_answers, :poll_question_id, :question_id end diff --git a/db/migrate/20171004210108_create_poll_question_answer_videos.rb b/db/migrate/20171004210108_create_poll_question_answer_videos.rb index 7cce33b29..d22b10adf 100644 --- a/db/migrate/20171004210108_create_poll_question_answer_videos.rb +++ b/db/migrate/20171004210108_create_poll_question_answer_videos.rb @@ -1,4 +1,4 @@ -class CreatePollQuestionAnswerVideos < ActiveRecord::Migration +class CreatePollQuestionAnswerVideos < ActiveRecord::Migration[4.2] def change create_table :poll_question_answer_videos do |t| t.string :title diff --git a/db/migrate/20171006145053_add_token_to_poll_voters.rb b/db/migrate/20171006145053_add_token_to_poll_voters.rb index 5d07f5065..c0fcc347e 100644 --- a/db/migrate/20171006145053_add_token_to_poll_voters.rb +++ b/db/migrate/20171006145053_add_token_to_poll_voters.rb @@ -1,4 +1,4 @@ -class AddTokenToPollVoters < ActiveRecord::Migration +class AddTokenToPollVoters < ActiveRecord::Migration[4.2] def change add_column :poll_voters, :token, :string end diff --git a/db/migrate/20171010143623_add_given_order_to_poll_question_answers.rb b/db/migrate/20171010143623_add_given_order_to_poll_question_answers.rb index 6161e55e4..0fc73939b 100644 --- a/db/migrate/20171010143623_add_given_order_to_poll_question_answers.rb +++ b/db/migrate/20171010143623_add_given_order_to_poll_question_answers.rb @@ -1,4 +1,4 @@ -class AddGivenOrderToPollQuestionAnswers < ActiveRecord::Migration +class AddGivenOrderToPollQuestionAnswers < ActiveRecord::Migration[4.2] def change add_column :poll_question_answers, :given_order, :integer, default: 1 end diff --git a/db/migrate/20171017221546_remove_poll_question_valid_answers.rb b/db/migrate/20171017221546_remove_poll_question_valid_answers.rb index e4c1ebb11..5a803fff6 100644 --- a/db/migrate/20171017221546_remove_poll_question_valid_answers.rb +++ b/db/migrate/20171017221546_remove_poll_question_valid_answers.rb @@ -1,4 +1,4 @@ -class RemovePollQuestionValidAnswers < ActiveRecord::Migration +class RemovePollQuestionValidAnswers < ActiveRecord::Migration[4.2] def change remove_column :poll_questions, :valid_answers end diff --git a/db/migrate/20171019095042_add_most_voted_to_poll_question_answer.rb b/db/migrate/20171019095042_add_most_voted_to_poll_question_answer.rb index e4650643b..d6f869f10 100644 --- a/db/migrate/20171019095042_add_most_voted_to_poll_question_answer.rb +++ b/db/migrate/20171019095042_add_most_voted_to_poll_question_answer.rb @@ -1,4 +1,4 @@ -class AddMostVotedToPollQuestionAnswer < ActiveRecord::Migration +class AddMostVotedToPollQuestionAnswer < ActiveRecord::Migration[4.2] def change add_column :poll_question_answers, :most_voted, :boolean, default: false end diff --git a/db/migrate/20171020163240_add_results_and_stats_to_polls.rb b/db/migrate/20171020163240_add_results_and_stats_to_polls.rb index af6f82aaa..2d5b0332b 100644 --- a/db/migrate/20171020163240_add_results_and_stats_to_polls.rb +++ b/db/migrate/20171020163240_add_results_and_stats_to_polls.rb @@ -1,4 +1,4 @@ -class AddResultsAndStatsToPolls < ActiveRecord::Migration +class AddResultsAndStatsToPolls < ActiveRecord::Migration[4.2] def change add_column :polls, :results_enabled, :boolean, default: false add_column :polls, :stats_enabled, :boolean, default: false diff --git a/db/migrate/20171025142440_add_cached_votes_to_legislation_proposals.rb b/db/migrate/20171025142440_add_cached_votes_to_legislation_proposals.rb index 92544ddb6..98500beb5 100644 --- a/db/migrate/20171025142440_add_cached_votes_to_legislation_proposals.rb +++ b/db/migrate/20171025142440_add_cached_votes_to_legislation_proposals.rb @@ -1,4 +1,4 @@ -class AddCachedVotesToLegislationProposals < ActiveRecord::Migration +class AddCachedVotesToLegislationProposals < ActiveRecord::Migration[4.2] def change add_column :legislation_proposals, :cached_votes_total, :integer, default: 0 add_column :legislation_proposals, :cached_votes_down, :integer, default: 0 diff --git a/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb b/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb index 13bc51264..895a93ecf 100644 --- a/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb +++ b/db/migrate/20171115164152_add_time_zone_to_default_datetimes.rb @@ -1,4 +1,4 @@ -class AddTimeZoneToDefaultDatetimes < ActiveRecord::Migration +class AddTimeZoneToDefaultDatetimes < ActiveRecord::Migration[4.2] def change change_column_default :users, :password_changed_at, DateTime.new(2015, 1, 1, 1, 1, 1, '+00:00') change_column_default :locks, :locked_until, DateTime.new(2000, 1, 1, 1, 1, 1, '+00:00') diff --git a/db/migrate/20171127171925_create_related_content.rb b/db/migrate/20171127171925_create_related_content.rb index 2944938e2..e65dd2e96 100644 --- a/db/migrate/20171127171925_create_related_content.rb +++ b/db/migrate/20171127171925_create_related_content.rb @@ -1,4 +1,4 @@ -class CreateRelatedContent < ActiveRecord::Migration +class CreateRelatedContent < ActiveRecord::Migration[4.2] def change create_table :related_contents do |t| t.references :parent_relationable, polymorphic: true, index: { name: 'index_related_contents_on_parent_relationable' } diff --git a/db/migrate/20171127230716_add_time_reported_to_related_content.rb b/db/migrate/20171127230716_add_time_reported_to_related_content.rb index 5cca12cf3..d9804942d 100644 --- a/db/migrate/20171127230716_add_time_reported_to_related_content.rb +++ b/db/migrate/20171127230716_add_time_reported_to_related_content.rb @@ -1,4 +1,4 @@ -class AddTimeReportedToRelatedContent < ActiveRecord::Migration +class AddTimeReportedToRelatedContent < ActiveRecord::Migration[4.2] def change add_column :related_contents, :times_reported, :integer, default: 0 end diff --git a/db/migrate/20171212154048_add_publication_date_to_milestones.rb b/db/migrate/20171212154048_add_publication_date_to_milestones.rb index e5e37bb24..2c646c1fd 100644 --- a/db/migrate/20171212154048_add_publication_date_to_milestones.rb +++ b/db/migrate/20171212154048_add_publication_date_to_milestones.rb @@ -1,4 +1,4 @@ -class AddPublicationDateToMilestones < ActiveRecord::Migration +class AddPublicationDateToMilestones < ActiveRecord::Migration[4.2] def up change_table :budget_investment_milestones do |t| t.datetime :publication_date diff --git a/db/migrate/20171212193323_add_timestamps_to_polls.rb b/db/migrate/20171212193323_add_timestamps_to_polls.rb index 9c955b278..b8cece246 100644 --- a/db/migrate/20171212193323_add_timestamps_to_polls.rb +++ b/db/migrate/20171212193323_add_timestamps_to_polls.rb @@ -1,4 +1,4 @@ -class AddTimestampsToPolls < ActiveRecord::Migration +class AddTimestampsToPolls < ActiveRecord::Migration[4.2] def change add_timestamps :polls, null: true end diff --git a/db/migrate/20171215152244_change_related_content_times_reported_column.rb b/db/migrate/20171215152244_change_related_content_times_reported_column.rb index 7da58bba5..8a202d6b9 100644 --- a/db/migrate/20171215152244_change_related_content_times_reported_column.rb +++ b/db/migrate/20171215152244_change_related_content_times_reported_column.rb @@ -1,4 +1,4 @@ -class ChangeRelatedContentTimesReportedColumn < ActiveRecord::Migration +class ChangeRelatedContentTimesReportedColumn < ActiveRecord::Migration[4.2] def change rename_column :related_contents, :times_reported, :flags_count end diff --git a/db/migrate/20171219111046_remove_related_contents_flags_count.rb b/db/migrate/20171219111046_remove_related_contents_flags_count.rb index b0f5aead5..a7eb00fc4 100644 --- a/db/migrate/20171219111046_remove_related_contents_flags_count.rb +++ b/db/migrate/20171219111046_remove_related_contents_flags_count.rb @@ -1,4 +1,4 @@ -class RemoveRelatedContentsFlagsCount < ActiveRecord::Migration +class RemoveRelatedContentsFlagsCount < ActiveRecord::Migration[4.2] def change remove_column :related_contents, :flags_count end diff --git a/db/migrate/20171219184209_create_related_content_scores.rb b/db/migrate/20171219184209_create_related_content_scores.rb index 7a54ba56d..c5136cbfc 100644 --- a/db/migrate/20171219184209_create_related_content_scores.rb +++ b/db/migrate/20171219184209_create_related_content_scores.rb @@ -1,4 +1,4 @@ -class CreateRelatedContentScores < ActiveRecord::Migration +class CreateRelatedContentScores < ActiveRecord::Migration[4.2] def change create_table :related_content_scores do |t| t.references :user, index: true, foreign_key: true diff --git a/db/migrate/20171219235102_add_hidden_at_to_related_contents.rb b/db/migrate/20171219235102_add_hidden_at_to_related_contents.rb index 423eeb1f1..a157b6e7a 100644 --- a/db/migrate/20171219235102_add_hidden_at_to_related_contents.rb +++ b/db/migrate/20171219235102_add_hidden_at_to_related_contents.rb @@ -1,4 +1,4 @@ -class AddHiddenAtToRelatedContents < ActiveRecord::Migration +class AddHiddenAtToRelatedContents < ActiveRecord::Migration[4.2] def change add_column :related_contents, :hidden_at, :datetime add_index :related_contents, :hidden_at diff --git a/db/migrate/20171220002802_add_related_content_scores_counter_to_related_content.rb b/db/migrate/20171220002802_add_related_content_scores_counter_to_related_content.rb index 497d4f7a1..5193e962a 100644 --- a/db/migrate/20171220002802_add_related_content_scores_counter_to_related_content.rb +++ b/db/migrate/20171220002802_add_related_content_scores_counter_to_related_content.rb @@ -1,4 +1,4 @@ -class AddRelatedContentScoresCounterToRelatedContent < ActiveRecord::Migration +class AddRelatedContentScoresCounterToRelatedContent < ActiveRecord::Migration[4.2] def change add_column :related_contents, :related_content_scores_count, :integer, default: 0 end diff --git a/db/migrate/20171220010000_add_author_to_related_content.rb b/db/migrate/20171220010000_add_author_to_related_content.rb index 4ca621845..3f63a96da 100644 --- a/db/migrate/20171220010000_add_author_to_related_content.rb +++ b/db/migrate/20171220010000_add_author_to_related_content.rb @@ -1,4 +1,4 @@ -class AddAuthorToRelatedContent < ActiveRecord::Migration +class AddAuthorToRelatedContent < ActiveRecord::Migration[4.2] def change add_column :related_contents, :author_id, :integer end diff --git a/db/migrate/20180108182839_add_drafting_phase_to_budget.rb b/db/migrate/20180108182839_add_drafting_phase_to_budget.rb index 9a8febb97..c0a18d449 100644 --- a/db/migrate/20180108182839_add_drafting_phase_to_budget.rb +++ b/db/migrate/20180108182839_add_drafting_phase_to_budget.rb @@ -1,4 +1,4 @@ -class AddDraftingPhaseToBudget < ActiveRecord::Migration +class AddDraftingPhaseToBudget < ActiveRecord::Migration[4.2] def change add_column :budgets, :description_drafting, :text end diff --git a/db/migrate/20180109081115_add_settings_to_banners.rb b/db/migrate/20180109081115_add_settings_to_banners.rb index 5092501cc..9a6ac6e0f 100644 --- a/db/migrate/20180109081115_add_settings_to_banners.rb +++ b/db/migrate/20180109081115_add_settings_to_banners.rb @@ -1,4 +1,4 @@ -class AddSettingsToBanners < ActiveRecord::Migration +class AddSettingsToBanners < ActiveRecord::Migration[4.2] def change add_column :banners, :background_color, :text add_column :banners, :font_color, :text diff --git a/db/migrate/20180109101656_create_banner_sections.rb b/db/migrate/20180109101656_create_banner_sections.rb index 3182858d8..5b9571096 100644 --- a/db/migrate/20180109101656_create_banner_sections.rb +++ b/db/migrate/20180109101656_create_banner_sections.rb @@ -1,4 +1,4 @@ -class CreateBannerSections < ActiveRecord::Migration +class CreateBannerSections < ActiveRecord::Migration[4.2] def change create_table :banner_sections do |t| t.integer :banner_id diff --git a/db/migrate/20180109175851_add_publishing_prices_phase_to_budget.rb b/db/migrate/20180109175851_add_publishing_prices_phase_to_budget.rb index e6181f6e1..b8141eac6 100644 --- a/db/migrate/20180109175851_add_publishing_prices_phase_to_budget.rb +++ b/db/migrate/20180109175851_add_publishing_prices_phase_to_budget.rb @@ -1,4 +1,4 @@ -class AddPublishingPricesPhaseToBudget < ActiveRecord::Migration +class AddPublishingPricesPhaseToBudget < ActiveRecord::Migration[4.2] def change add_column :budgets, :description_publishing_prices, :text end diff --git a/db/migrate/20180112123641_create_budget_phases.rb b/db/migrate/20180112123641_create_budget_phases.rb index fbac158f0..259b01f2c 100644 --- a/db/migrate/20180112123641_create_budget_phases.rb +++ b/db/migrate/20180112123641_create_budget_phases.rb @@ -1,4 +1,4 @@ -class CreateBudgetPhases < ActiveRecord::Migration +class CreateBudgetPhases < ActiveRecord::Migration[4.2] def change create_table :budget_phases do |t| t.references :budget diff --git a/db/migrate/20180115075542_create_web_sections.rb b/db/migrate/20180115075542_create_web_sections.rb index 483bc7bb7..cafbb433e 100644 --- a/db/migrate/20180115075542_create_web_sections.rb +++ b/db/migrate/20180115075542_create_web_sections.rb @@ -1,4 +1,4 @@ -class CreateWebSections < ActiveRecord::Migration +class CreateWebSections < ActiveRecord::Migration[4.2] def change create_table :web_sections do |t| t.text :name diff --git a/db/migrate/20180116151008_add_visible_to_valuators_to_budget_investment.rb b/db/migrate/20180116151008_add_visible_to_valuators_to_budget_investment.rb index 8a04a14a5..db011179d 100644 --- a/db/migrate/20180116151008_add_visible_to_valuators_to_budget_investment.rb +++ b/db/migrate/20180116151008_add_visible_to_valuators_to_budget_investment.rb @@ -1,4 +1,4 @@ -class AddVisibleToValuatorsToBudgetInvestment < ActiveRecord::Migration +class AddVisibleToValuatorsToBudgetInvestment < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :visible_to_valuators, :boolean, default: false end diff --git a/db/migrate/20180119073228_add_description_informing_to_budgets.rb b/db/migrate/20180119073228_add_description_informing_to_budgets.rb index a6eb173e9..d06fbf500 100644 --- a/db/migrate/20180119073228_add_description_informing_to_budgets.rb +++ b/db/migrate/20180119073228_add_description_informing_to_budgets.rb @@ -1,4 +1,4 @@ -class AddDescriptionInformingToBudgets < ActiveRecord::Migration +class AddDescriptionInformingToBudgets < ActiveRecord::Migration[4.2] def change add_column :budgets, :description_informing, :text end diff --git a/db/migrate/20180124143013_remove_image_and_style_from_banners.rb b/db/migrate/20180124143013_remove_image_and_style_from_banners.rb index 6ce833437..dbf72c489 100644 --- a/db/migrate/20180124143013_remove_image_and_style_from_banners.rb +++ b/db/migrate/20180124143013_remove_image_and_style_from_banners.rb @@ -1,4 +1,4 @@ -class RemoveImageAndStyleFromBanners < ActiveRecord::Migration +class RemoveImageAndStyleFromBanners < ActiveRecord::Migration[4.2] def change remove_column :banners, :image remove_column :banners, :style diff --git a/db/migrate/20180129190931_add_valuation_flag_to_comments.rb b/db/migrate/20180129190931_add_valuation_flag_to_comments.rb index cf31a92e7..f2eea0f91 100644 --- a/db/migrate/20180129190931_add_valuation_flag_to_comments.rb +++ b/db/migrate/20180129190931_add_valuation_flag_to_comments.rb @@ -1,4 +1,4 @@ -class AddValuationFlagToComments < ActiveRecord::Migration +class AddValuationFlagToComments < ActiveRecord::Migration[4.2] def change add_column :comments, :valuation, :boolean, default: false end diff --git a/db/migrate/20180129190950_add_index_to_valuation_comments.rb b/db/migrate/20180129190950_add_index_to_valuation_comments.rb index 2816d15b0..9a3159e38 100644 --- a/db/migrate/20180129190950_add_index_to_valuation_comments.rb +++ b/db/migrate/20180129190950_add_index_to_valuation_comments.rb @@ -1,4 +1,4 @@ -class AddIndexToValuationComments < ActiveRecord::Migration +class AddIndexToValuationComments < ActiveRecord::Migration[4.2] disable_ddl_transaction! def change diff --git a/db/migrate/20180131011426_remove_internal_comments_from_investment.rb b/db/migrate/20180131011426_remove_internal_comments_from_investment.rb index b104e2bae..f37c1b1d1 100644 --- a/db/migrate/20180131011426_remove_internal_comments_from_investment.rb +++ b/db/migrate/20180131011426_remove_internal_comments_from_investment.rb @@ -1,4 +1,4 @@ -class RemoveInternalCommentsFromInvestment < ActiveRecord::Migration +class RemoveInternalCommentsFromInvestment < ActiveRecord::Migration[4.2] def change remove_column :budget_investments, :internal_comments end diff --git a/db/migrate/20180205170054_create_newsletters.rb b/db/migrate/20180205170054_create_newsletters.rb index bd434c7a8..0ba59b16a 100644 --- a/db/migrate/20180205170054_create_newsletters.rb +++ b/db/migrate/20180205170054_create_newsletters.rb @@ -1,4 +1,4 @@ -class CreateNewsletters < ActiveRecord::Migration +class CreateNewsletters < ActiveRecord::Migration[4.2] def change create_table :newsletters do |t| t.string :subject diff --git a/db/migrate/20180208151658_create_valuator_groups.rb b/db/migrate/20180208151658_create_valuator_groups.rb index 441478cc5..7f6823e01 100644 --- a/db/migrate/20180208151658_create_valuator_groups.rb +++ b/db/migrate/20180208151658_create_valuator_groups.rb @@ -1,4 +1,4 @@ -class CreateValuatorGroups < ActiveRecord::Migration +class CreateValuatorGroups < ActiveRecord::Migration[4.2] def change create_table :valuator_groups do |t| t.string :name diff --git a/db/migrate/20180208163135_add_valuator_group_to_valuators.rb b/db/migrate/20180208163135_add_valuator_group_to_valuators.rb index 93ec65e17..366fe5376 100644 --- a/db/migrate/20180208163135_add_valuator_group_to_valuators.rb +++ b/db/migrate/20180208163135_add_valuator_group_to_valuators.rb @@ -1,4 +1,4 @@ -class AddValuatorGroupToValuators < ActiveRecord::Migration +class AddValuatorGroupToValuators < ActiveRecord::Migration[4.2] def change add_column :valuators, :valuator_group_id, :integer end diff --git a/db/migrate/20180208200659_create_budget_valuator_group_assignment.rb b/db/migrate/20180208200659_create_budget_valuator_group_assignment.rb index 916ed298e..97f3e48f5 100644 --- a/db/migrate/20180208200659_create_budget_valuator_group_assignment.rb +++ b/db/migrate/20180208200659_create_budget_valuator_group_assignment.rb @@ -1,4 +1,4 @@ -class CreateBudgetValuatorGroupAssignment < ActiveRecord::Migration +class CreateBudgetValuatorGroupAssignment < ActiveRecord::Migration[4.2] def change create_table :budget_valuator_group_assignments do |t| t.integer :valuator_group_id diff --git a/db/migrate/20180211182635_add_budget_valuator_group_assignments_counters.rb b/db/migrate/20180211182635_add_budget_valuator_group_assignments_counters.rb index 93619a5a9..59868d2bf 100644 --- a/db/migrate/20180211182635_add_budget_valuator_group_assignments_counters.rb +++ b/db/migrate/20180211182635_add_budget_valuator_group_assignments_counters.rb @@ -1,4 +1,4 @@ -class AddBudgetValuatorGroupAssignmentsCounters < ActiveRecord::Migration +class AddBudgetValuatorGroupAssignmentsCounters < ActiveRecord::Migration[4.2] def change add_column :budget_investments, :valuator_group_assignments_count, :integer, default: 0 add_column :valuator_groups, :budget_investments_count, :integer, default: 0 diff --git a/db/migrate/20180220211105_change_newsletter_segment_recipient_to_string.rb b/db/migrate/20180220211105_change_newsletter_segment_recipient_to_string.rb index 1f87a56f5..4d34e4303 100644 --- a/db/migrate/20180220211105_change_newsletter_segment_recipient_to_string.rb +++ b/db/migrate/20180220211105_change_newsletter_segment_recipient_to_string.rb @@ -1,4 +1,4 @@ -class ChangeNewsletterSegmentRecipientToString < ActiveRecord::Migration +class ChangeNewsletterSegmentRecipientToString < ActiveRecord::Migration[4.2] def change change_column :newsletters, :segment_recipient, :string, null: false end diff --git a/db/migrate/20180221002503_create_admin_notifications.rb b/db/migrate/20180221002503_create_admin_notifications.rb index 041931495..c7343d242 100644 --- a/db/migrate/20180221002503_create_admin_notifications.rb +++ b/db/migrate/20180221002503_create_admin_notifications.rb @@ -1,4 +1,4 @@ -class CreateAdminNotifications < ActiveRecord::Migration +class CreateAdminNotifications < ActiveRecord::Migration[4.2] def change create_table :admin_notifications do |t| t.string :title diff --git a/db/migrate/20180222120017_add_read_at_to_notifications.rb b/db/migrate/20180222120017_add_read_at_to_notifications.rb index c65186340..0a9704668 100644 --- a/db/migrate/20180222120017_add_read_at_to_notifications.rb +++ b/db/migrate/20180222120017_add_read_at_to_notifications.rb @@ -1,4 +1,4 @@ -class AddReadAtToNotifications < ActiveRecord::Migration +class AddReadAtToNotifications < ActiveRecord::Migration[4.2] def change add_column :notifications, :read_at, :timestamp end diff --git a/db/migrate/20180320104823_add_max_votable_headings_to_budget_groups.rb b/db/migrate/20180320104823_add_max_votable_headings_to_budget_groups.rb index e030b7b13..5511065d2 100644 --- a/db/migrate/20180320104823_add_max_votable_headings_to_budget_groups.rb +++ b/db/migrate/20180320104823_add_max_votable_headings_to_budget_groups.rb @@ -1,4 +1,4 @@ -class AddMaxVotableHeadingsToBudgetGroups < ActiveRecord::Migration +class AddMaxVotableHeadingsToBudgetGroups < ActiveRecord::Migration[4.2] def change add_column :budget_groups, :max_votable_headings, :integer, default: 1 end diff --git a/db/migrate/20180321140337_create_budget_investment_statuses.rb b/db/migrate/20180321140337_create_budget_investment_statuses.rb index 292644ede..d3fff0a20 100644 --- a/db/migrate/20180321140337_create_budget_investment_statuses.rb +++ b/db/migrate/20180321140337_create_budget_investment_statuses.rb @@ -1,4 +1,4 @@ -class CreateBudgetInvestmentStatuses < ActiveRecord::Migration +class CreateBudgetInvestmentStatuses < ActiveRecord::Migration[4.2] def change create_table :budget_investment_statuses do |t| t.string :name diff --git a/db/migrate/20180321180149_add_status_to_milestones.rb b/db/migrate/20180321180149_add_status_to_milestones.rb index 527d87181..9d117c3d9 100644 --- a/db/migrate/20180321180149_add_status_to_milestones.rb +++ b/db/migrate/20180321180149_add_status_to_milestones.rb @@ -1,4 +1,4 @@ -class AddStatusToMilestones < ActiveRecord::Migration +class AddStatusToMilestones < ActiveRecord::Migration[4.2] disable_ddl_transaction! def change diff --git a/db/migrate/20180323190027_add_translate_milestones.rb b/db/migrate/20180323190027_add_translate_milestones.rb index 2a629a473..978d227e7 100644 --- a/db/migrate/20180323190027_add_translate_milestones.rb +++ b/db/migrate/20180323190027_add_translate_milestones.rb @@ -1,4 +1,4 @@ -class AddTranslateMilestones < ActiveRecord::Migration +class AddTranslateMilestones < ActiveRecord::Migration[4.2] def change create_table :budget_investment_milestone_translations do |t| t.integer :budget_investment_milestone_id, null: false diff --git a/db/migrate/20180516091302_create_widget_cards.rb b/db/migrate/20180516091302_create_widget_cards.rb index f957ae231..b1595838e 100644 --- a/db/migrate/20180516091302_create_widget_cards.rb +++ b/db/migrate/20180516091302_create_widget_cards.rb @@ -1,4 +1,4 @@ -class CreateWidgetCards < ActiveRecord::Migration +class CreateWidgetCards < ActiveRecord::Migration[4.2] def change create_table :widget_cards do |t| t.string :title diff --git a/db/migrate/20180516105911_add_moderation_flags_to_proposal_notifications.rb b/db/migrate/20180516105911_add_moderation_flags_to_proposal_notifications.rb index f62c1e1cf..588da19fe 100644 --- a/db/migrate/20180516105911_add_moderation_flags_to_proposal_notifications.rb +++ b/db/migrate/20180516105911_add_moderation_flags_to_proposal_notifications.rb @@ -1,4 +1,4 @@ -class AddModerationFlagsToProposalNotifications < ActiveRecord::Migration +class AddModerationFlagsToProposalNotifications < ActiveRecord::Migration[4.2] def change add_column :proposal_notifications, :moderated, :boolean, default: false add_column :proposal_notifications, :hidden_at, :datetime diff --git a/db/migrate/20180517141120_add_hidden_at_to_newsletters.rb b/db/migrate/20180517141120_add_hidden_at_to_newsletters.rb index 5e1b4b8cf..08fd47d66 100644 --- a/db/migrate/20180517141120_add_hidden_at_to_newsletters.rb +++ b/db/migrate/20180517141120_add_hidden_at_to_newsletters.rb @@ -1,4 +1,4 @@ -class AddHiddenAtToNewsletters < ActiveRecord::Migration +class AddHiddenAtToNewsletters < ActiveRecord::Migration[4.2] def change add_column :newsletters, :hidden_at, :datetime end diff --git a/db/migrate/20180519132610_create_widget_feeds.rb b/db/migrate/20180519132610_create_widget_feeds.rb index e01d1f3ad..721e3a4fc 100644 --- a/db/migrate/20180519132610_create_widget_feeds.rb +++ b/db/migrate/20180519132610_create_widget_feeds.rb @@ -1,4 +1,4 @@ -class CreateWidgetFeeds < ActiveRecord::Migration +class CreateWidgetFeeds < ActiveRecord::Migration[4.2] def change create_table :widget_feeds do |t| t.string :kind diff --git a/db/migrate/20180604124515_add_recommended_debates_setting_to_users.rb b/db/migrate/20180604124515_add_recommended_debates_setting_to_users.rb index 500f1f4fc..033de6c81 100644 --- a/db/migrate/20180604124515_add_recommended_debates_setting_to_users.rb +++ b/db/migrate/20180604124515_add_recommended_debates_setting_to_users.rb @@ -1,4 +1,4 @@ -class AddRecommendedDebatesSettingToUsers < ActiveRecord::Migration +class AddRecommendedDebatesSettingToUsers < ActiveRecord::Migration[4.2] def change change_table :users do |t| t.boolean :recommended_debates, default: false diff --git a/db/migrate/20180604151014_add_recommended_proposals_setting_to_users.rb b/db/migrate/20180604151014_add_recommended_proposals_setting_to_users.rb index 53a59e210..1a5cb9eb9 100644 --- a/db/migrate/20180604151014_add_recommended_proposals_setting_to_users.rb +++ b/db/migrate/20180604151014_add_recommended_proposals_setting_to_users.rb @@ -1,4 +1,4 @@ -class AddRecommendedProposalsSettingToUsers < ActiveRecord::Migration +class AddRecommendedProposalsSettingToUsers < ActiveRecord::Migration[4.2] def change change_table :users do |t| t.boolean :recommended_proposals, default: false diff --git a/db/migrate/20180613143922_add_moderation_attrs_to_investments.rb b/db/migrate/20180613143922_add_moderation_attrs_to_investments.rb index ebb4fdf1a..34edacef7 100644 --- a/db/migrate/20180613143922_add_moderation_attrs_to_investments.rb +++ b/db/migrate/20180613143922_add_moderation_attrs_to_investments.rb @@ -1,4 +1,4 @@ -class AddModerationAttrsToInvestments < ActiveRecord::Migration +class AddModerationAttrsToInvestments < ActiveRecord::Migration[4.2] def change change_table :budget_investments do |t| t.datetime :confirmed_hide_at diff --git a/db/migrate/20180711224810_enable_recommendations_by_default.rb b/db/migrate/20180711224810_enable_recommendations_by_default.rb index ece94e1b8..9acafcf98 100644 --- a/db/migrate/20180711224810_enable_recommendations_by_default.rb +++ b/db/migrate/20180711224810_enable_recommendations_by_default.rb @@ -1,4 +1,4 @@ -class EnableRecommendationsByDefault < ActiveRecord::Migration +class EnableRecommendationsByDefault < ActiveRecord::Migration[4.2] def change change_column_default :users, :recommended_debates, true change_column_default :users, :recommended_proposals, true diff --git a/db/migrate/20180713103402_change_budget_investment_statuses_to_milestone_statuses.rb b/db/migrate/20180713103402_change_budget_investment_statuses_to_milestone_statuses.rb index 05deae5a7..02dec73bc 100644 --- a/db/migrate/20180713103402_change_budget_investment_statuses_to_milestone_statuses.rb +++ b/db/migrate/20180713103402_change_budget_investment_statuses_to_milestone_statuses.rb @@ -1,4 +1,4 @@ -class ChangeBudgetInvestmentStatusesToMilestoneStatuses < ActiveRecord::Migration +class ChangeBudgetInvestmentStatusesToMilestoneStatuses < ActiveRecord::Migration[4.2] def change create_table :milestone_statuses do |t| t.string :name diff --git a/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb b/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb index 9d8ce901e..3b9b8d54d 100644 --- a/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb +++ b/db/migrate/20180713124501_make_investment_milestones_polymorphic.rb @@ -1,4 +1,4 @@ -class MakeInvestmentMilestonesPolymorphic < ActiveRecord::Migration +class MakeInvestmentMilestonesPolymorphic < ActiveRecord::Migration[4.2] def change create_table :milestones do |t| t.references :milestoneable, polymorphic: true diff --git a/db/migrate/20180718115545_create_i18n_content_translations.rb b/db/migrate/20180718115545_create_i18n_content_translations.rb index 8e6fde21c..478ef6d8e 100644 --- a/db/migrate/20180718115545_create_i18n_content_translations.rb +++ b/db/migrate/20180718115545_create_i18n_content_translations.rb @@ -1,4 +1,4 @@ -class CreateI18nContentTranslations < ActiveRecord::Migration +class CreateI18nContentTranslations < ActiveRecord::Migration[4.2] def change create_table :i18n_contents do |t| t.string :key diff --git a/db/migrate/20180727140800_add_banner_translations.rb b/db/migrate/20180727140800_add_banner_translations.rb index 4c4c9391e..e6587deeb 100644 --- a/db/migrate/20180727140800_add_banner_translations.rb +++ b/db/migrate/20180727140800_add_banner_translations.rb @@ -1,4 +1,4 @@ -class AddBannerTranslations < ActiveRecord::Migration +class AddBannerTranslations < ActiveRecord::Migration[4.2] def self.up Banner.create_translation_table!( diff --git a/db/migrate/20180730120800_add_homepage_content_translations.rb b/db/migrate/20180730120800_add_homepage_content_translations.rb index b344f95c3..c55e1af3f 100644 --- a/db/migrate/20180730120800_add_homepage_content_translations.rb +++ b/db/migrate/20180730120800_add_homepage_content_translations.rb @@ -1,4 +1,4 @@ -class AddHomepageContentTranslations < ActiveRecord::Migration +class AddHomepageContentTranslations < ActiveRecord::Migration[4.2] def self.up Widget::Card.create_translation_table!( diff --git a/db/migrate/20180730213824_add_poll_translations.rb b/db/migrate/20180730213824_add_poll_translations.rb index 75495d327..48837c550 100644 --- a/db/migrate/20180730213824_add_poll_translations.rb +++ b/db/migrate/20180730213824_add_poll_translations.rb @@ -1,4 +1,4 @@ -class AddPollTranslations < ActiveRecord::Migration +class AddPollTranslations < ActiveRecord::Migration[4.2] def self.up Poll.create_translation_table!( diff --git a/db/migrate/20180731150800_add_admin_notification_translations.rb b/db/migrate/20180731150800_add_admin_notification_translations.rb index fb76a42d2..83dfb3cf9 100644 --- a/db/migrate/20180731150800_add_admin_notification_translations.rb +++ b/db/migrate/20180731150800_add_admin_notification_translations.rb @@ -1,4 +1,4 @@ -class AddAdminNotificationTranslations < ActiveRecord::Migration +class AddAdminNotificationTranslations < ActiveRecord::Migration[4.2] def self.up AdminNotification.create_translation_table!( diff --git a/db/migrate/20180731173147_add_poll_question_translations.rb b/db/migrate/20180731173147_add_poll_question_translations.rb index f62fbc161..f099e49b9 100644 --- a/db/migrate/20180731173147_add_poll_question_translations.rb +++ b/db/migrate/20180731173147_add_poll_question_translations.rb @@ -1,4 +1,4 @@ -class AddPollQuestionTranslations < ActiveRecord::Migration +class AddPollQuestionTranslations < ActiveRecord::Migration[4.2] def self.up Poll::Question.create_translation_table!( diff --git a/db/migrate/20180801114529_add_poll_question_answer_translations.rb b/db/migrate/20180801114529_add_poll_question_answer_translations.rb index 3203d7a1f..5f9a8cada 100644 --- a/db/migrate/20180801114529_add_poll_question_answer_translations.rb +++ b/db/migrate/20180801114529_add_poll_question_answer_translations.rb @@ -1,4 +1,4 @@ -class AddPollQuestionAnswerTranslations < ActiveRecord::Migration +class AddPollQuestionAnswerTranslations < ActiveRecord::Migration[4.2] def self.up Poll::Question::Answer.create_translation_table!( diff --git a/db/migrate/20180801140800_add_collaborative_legislation_translations.rb b/db/migrate/20180801140800_add_collaborative_legislation_translations.rb index 569689a73..80d9d1f5b 100644 --- a/db/migrate/20180801140800_add_collaborative_legislation_translations.rb +++ b/db/migrate/20180801140800_add_collaborative_legislation_translations.rb @@ -1,4 +1,4 @@ -class AddCollaborativeLegislationTranslations < ActiveRecord::Migration +class AddCollaborativeLegislationTranslations < ActiveRecord::Migration[4.2] def self.up Legislation::Process.create_translation_table!( diff --git a/db/migrate/20180807104331_add_selected_to_legislation_proposals.rb b/db/migrate/20180807104331_add_selected_to_legislation_proposals.rb index 6696c2796..2342b04a2 100644 --- a/db/migrate/20180807104331_add_selected_to_legislation_proposals.rb +++ b/db/migrate/20180807104331_add_selected_to_legislation_proposals.rb @@ -1,4 +1,4 @@ -class AddSelectedToLegislationProposals < ActiveRecord::Migration +class AddSelectedToLegislationProposals < ActiveRecord::Migration[4.2] def change add_column :legislation_proposals, :selected, :boolean end diff --git a/db/migrate/20180813141443_create_ckeditor_assets.rb b/db/migrate/20180813141443_create_ckeditor_assets.rb index f7b5b85f4..2610bc5f5 100644 --- a/db/migrate/20180813141443_create_ckeditor_assets.rb +++ b/db/migrate/20180813141443_create_ckeditor_assets.rb @@ -1,4 +1,4 @@ -class CreateCkeditorAssets < ActiveRecord::Migration +class CreateCkeditorAssets < ActiveRecord::Migration[4.2] def self.up create_table :ckeditor_assets do |t| t.string :data_file_name, null: false diff --git a/db/migrate/20180924071722_add_translate_pages.rb b/db/migrate/20180924071722_add_translate_pages.rb index 250f46dee..f29d34600 100644 --- a/db/migrate/20180924071722_add_translate_pages.rb +++ b/db/migrate/20180924071722_add_translate_pages.rb @@ -1,4 +1,4 @@ -class AddTranslatePages < ActiveRecord::Migration +class AddTranslatePages < ActiveRecord::Migration[4.2] def self.up SiteCustomization::Page.create_translation_table!( { diff --git a/db/migrate/20181016204729_add_draft_phase_to_legislation_processes.rb b/db/migrate/20181016204729_add_draft_phase_to_legislation_processes.rb index f2b6220cb..7c3e017eb 100644 --- a/db/migrate/20181016204729_add_draft_phase_to_legislation_processes.rb +++ b/db/migrate/20181016204729_add_draft_phase_to_legislation_processes.rb @@ -1,4 +1,4 @@ -class AddDraftPhaseToLegislationProcesses < ActiveRecord::Migration +class AddDraftPhaseToLegislationProcesses < ActiveRecord::Migration[4.2] def change add_column :legislation_processes, :draft_start_date, :date add_index :legislation_processes, :draft_start_date diff --git a/db/migrate/20181108103111_add_allow_custom_content_to_headings.rb b/db/migrate/20181108103111_add_allow_custom_content_to_headings.rb index cf65b6fa3..609f5a03a 100644 --- a/db/migrate/20181108103111_add_allow_custom_content_to_headings.rb +++ b/db/migrate/20181108103111_add_allow_custom_content_to_headings.rb @@ -1,4 +1,4 @@ -class AddAllowCustomContentToHeadings < ActiveRecord::Migration +class AddAllowCustomContentToHeadings < ActiveRecord::Migration[4.2] def change add_column :budget_headings, :allow_custom_content, :boolean, default: false end diff --git a/db/migrate/20181108142513_create_heading_content_blocks.rb b/db/migrate/20181108142513_create_heading_content_blocks.rb index 17db70e8c..1111f7e3a 100644 --- a/db/migrate/20181108142513_create_heading_content_blocks.rb +++ b/db/migrate/20181108142513_create_heading_content_blocks.rb @@ -1,4 +1,4 @@ -class CreateHeadingContentBlocks < ActiveRecord::Migration +class CreateHeadingContentBlocks < ActiveRecord::Migration[4.2] def change create_table :budget_content_blocks do |t| t.integer :heading_id, index: true, foreign_key: true diff --git a/db/migrate/20181109111037_add_location_to_headings.rb b/db/migrate/20181109111037_add_location_to_headings.rb index 973cdf38e..8695fe455 100644 --- a/db/migrate/20181109111037_add_location_to_headings.rb +++ b/db/migrate/20181109111037_add_location_to_headings.rb @@ -1,4 +1,4 @@ -class AddLocationToHeadings < ActiveRecord::Migration +class AddLocationToHeadings < ActiveRecord::Migration[4.2] def change add_column :budget_headings, :latitude, :text add_column :budget_headings, :longitude, :text diff --git a/db/migrate/20181121123512_add_milestones_summary_to_legislation_process_translation.rb b/db/migrate/20181121123512_add_milestones_summary_to_legislation_process_translation.rb index c93b5d3fa..a93cfa6e3 100644 --- a/db/migrate/20181121123512_add_milestones_summary_to_legislation_process_translation.rb +++ b/db/migrate/20181121123512_add_milestones_summary_to_legislation_process_translation.rb @@ -1,4 +1,4 @@ -class AddMilestonesSummaryToLegislationProcessTranslation < ActiveRecord::Migration +class AddMilestonesSummaryToLegislationProcessTranslation < ActiveRecord::Migration[4.2] def change add_column :legislation_process_translations, :milestones_summary, :text end diff --git a/db/migrate/20181206153510_add_home_page_to_legislation_processes.rb b/db/migrate/20181206153510_add_home_page_to_legislation_processes.rb index f0b513f6d..101aedbfe 100644 --- a/db/migrate/20181206153510_add_home_page_to_legislation_processes.rb +++ b/db/migrate/20181206153510_add_home_page_to_legislation_processes.rb @@ -1,4 +1,4 @@ -class AddHomePageToLegislationProcesses < ActiveRecord::Migration +class AddHomePageToLegislationProcesses < ActiveRecord::Migration[4.2] def change add_column :legislation_processes, :homepage_enabled, :boolean, default: false diff --git a/db/migrate/20181218164126_add_site_customization_page_to_widget_cards.rb b/db/migrate/20181218164126_add_site_customization_page_to_widget_cards.rb index f4dad35fc..b6e0ea3fa 100644 --- a/db/migrate/20181218164126_add_site_customization_page_to_widget_cards.rb +++ b/db/migrate/20181218164126_add_site_customization_page_to_widget_cards.rb @@ -1,5 +1,5 @@ -class AddSiteCustomizationPageToWidgetCards < ActiveRecord::Migration +class AddSiteCustomizationPageToWidgetCards < ActiveRecord::Migration[4.2] def change add_reference :widget_cards, :site_customization_page, index: true end -end \ No newline at end of file +end diff --git a/db/migrate/20181220163447_add_header_color_settings_to_legislation_processes.rb b/db/migrate/20181220163447_add_header_color_settings_to_legislation_processes.rb index b4c7b3ad8..c1df62a9f 100644 --- a/db/migrate/20181220163447_add_header_color_settings_to_legislation_processes.rb +++ b/db/migrate/20181220163447_add_header_color_settings_to_legislation_processes.rb @@ -1,6 +1,6 @@ -class AddHeaderColorSettingsToLegislationProcesses < ActiveRecord::Migration +class AddHeaderColorSettingsToLegislationProcesses < ActiveRecord::Migration[4.2] def change add_column :legislation_processes, :background_color, :text add_column :legislation_processes, :font_color, :text end -end \ No newline at end of file +end diff --git a/db/migrate/20190103132925_create_progress_bars.rb b/db/migrate/20190103132925_create_progress_bars.rb index 899a4819f..3ada28004 100644 --- a/db/migrate/20190103132925_create_progress_bars.rb +++ b/db/migrate/20190103132925_create_progress_bars.rb @@ -1,4 +1,4 @@ -class CreateProgressBars < ActiveRecord::Migration +class CreateProgressBars < ActiveRecord::Migration[4.2] def change create_table :progress_bars do |t| t.integer :kind diff --git a/db/migrate/20190104160114_create_active_polls.rb b/db/migrate/20190104160114_create_active_polls.rb index 497c630da..a5340050a 100644 --- a/db/migrate/20190104160114_create_active_polls.rb +++ b/db/migrate/20190104160114_create_active_polls.rb @@ -1,4 +1,4 @@ -class CreateActivePolls < ActiveRecord::Migration +class CreateActivePolls < ActiveRecord::Migration[4.2] def change create_table :active_polls do |t| t.datetime :created_at, null: false diff --git a/db/migrate/20190104170114_add_active_polls_translations.rb b/db/migrate/20190104170114_add_active_polls_translations.rb index 9f43f8e9f..c6158a83e 100644 --- a/db/migrate/20190104170114_add_active_polls_translations.rb +++ b/db/migrate/20190104170114_add_active_polls_translations.rb @@ -1,4 +1,4 @@ -class AddActivePollsTranslations < ActiveRecord::Migration +class AddActivePollsTranslations < ActiveRecord::Migration[4.2] def self.up ActivePoll.create_translation_table!( diff --git a/db/migrate/20190118115237_add_cached_votes_score_to_legislation_proposals.rb b/db/migrate/20190118115237_add_cached_votes_score_to_legislation_proposals.rb index 29a02ed41..dc1d64703 100644 --- a/db/migrate/20190118115237_add_cached_votes_score_to_legislation_proposals.rb +++ b/db/migrate/20190118115237_add_cached_votes_score_to_legislation_proposals.rb @@ -1,4 +1,4 @@ -class AddCachedVotesScoreToLegislationProposals < ActiveRecord::Migration +class AddCachedVotesScoreToLegislationProposals < ActiveRecord::Migration[4.2] def change add_column :legislation_proposals, :cached_votes_score, :integer, default: 0 diff --git a/db/migrate/20190118135741_add_budget_translations.rb b/db/migrate/20190118135741_add_budget_translations.rb index 4ba7a94a9..19404d313 100644 --- a/db/migrate/20190118135741_add_budget_translations.rb +++ b/db/migrate/20190118135741_add_budget_translations.rb @@ -1,4 +1,4 @@ -class AddBudgetTranslations < ActiveRecord::Migration +class AddBudgetTranslations < ActiveRecord::Migration[4.2] def self.up Budget.create_translation_table!( diff --git a/db/migrate/20190119160418_add_budget_phase_translations.rb b/db/migrate/20190119160418_add_budget_phase_translations.rb index 45fff7db1..67e8afdc5 100644 --- a/db/migrate/20190119160418_add_budget_phase_translations.rb +++ b/db/migrate/20190119160418_add_budget_phase_translations.rb @@ -1,4 +1,4 @@ -class AddBudgetPhaseTranslations < ActiveRecord::Migration +class AddBudgetPhaseTranslations < ActiveRecord::Migration[4.2] def self.up Budget::Phase.create_translation_table!( diff --git a/db/migrate/20190120155819_add_budget_group_translations.rb b/db/migrate/20190120155819_add_budget_group_translations.rb index 7be1575d3..869906a35 100644 --- a/db/migrate/20190120155819_add_budget_group_translations.rb +++ b/db/migrate/20190120155819_add_budget_group_translations.rb @@ -1,4 +1,4 @@ -class AddBudgetGroupTranslations < ActiveRecord::Migration +class AddBudgetGroupTranslations < ActiveRecord::Migration[4.2] def self.up Budget::Group.create_translation_table!( diff --git a/db/migrate/20190121171237_add_budget_heading_translations.rb b/db/migrate/20190121171237_add_budget_heading_translations.rb index c56560e78..e0fa70268 100644 --- a/db/migrate/20190121171237_add_budget_heading_translations.rb +++ b/db/migrate/20190121171237_add_budget_heading_translations.rb @@ -1,4 +1,4 @@ -class AddBudgetHeadingTranslations < ActiveRecord::Migration +class AddBudgetHeadingTranslations < ActiveRecord::Migration[4.2] def self.up Budget::Heading.create_translation_table!( diff --git a/db/migrate/20190124084612_drop_annotations_table.rb b/db/migrate/20190124084612_drop_annotations_table.rb index eaf86595a..3e836df80 100644 --- a/db/migrate/20190124084612_drop_annotations_table.rb +++ b/db/migrate/20190124084612_drop_annotations_table.rb @@ -1,4 +1,4 @@ -class DropAnnotationsTable < ActiveRecord::Migration +class DropAnnotationsTable < ActiveRecord::Migration[4.2] def change drop_table :annotations end diff --git a/db/migrate/20190124085815_drop_legacy_legislations_table.rb b/db/migrate/20190124085815_drop_legacy_legislations_table.rb index 28381e1c2..a246a34ba 100644 --- a/db/migrate/20190124085815_drop_legacy_legislations_table.rb +++ b/db/migrate/20190124085815_drop_legacy_legislations_table.rb @@ -1,4 +1,4 @@ -class DropLegacyLegislationsTable < ActiveRecord::Migration +class DropLegacyLegislationsTable < ActiveRecord::Migration[4.2] def change drop_table :legacy_legislations end diff --git a/db/migrate/20190131122858_add_columns_to_widget_cards.rb b/db/migrate/20190131122858_add_columns_to_widget_cards.rb index f74343d1f..022b22e66 100644 --- a/db/migrate/20190131122858_add_columns_to_widget_cards.rb +++ b/db/migrate/20190131122858_add_columns_to_widget_cards.rb @@ -1,4 +1,4 @@ -class AddColumnsToWidgetCards < ActiveRecord::Migration +class AddColumnsToWidgetCards < ActiveRecord::Migration[4.2] def change add_column :widget_cards, :columns, :integer, default: 4 end diff --git a/db/migrate/20190205131722_increase_tag_name_limit.rb b/db/migrate/20190205131722_increase_tag_name_limit.rb index 6b60ee697..ede7f0a40 100644 --- a/db/migrate/20190205131722_increase_tag_name_limit.rb +++ b/db/migrate/20190205131722_increase_tag_name_limit.rb @@ -1,4 +1,4 @@ -class IncreaseTagNameLimit < ActiveRecord::Migration +class IncreaseTagNameLimit < ActiveRecord::Migration[4.2] def up change_column :tags, :name, :string, limit: 160 end From defbb25ec55c428d8f95736969e9ca9d84d14b8b Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Thu, 4 Apr 2019 16:38:37 +0200 Subject: [PATCH 099/104] Fix Devise deprecation warning DEPRECATION WARNING: [Devise] `DeviseHelper.devise_error_messages!` is deprecated and it will be removed in the next major version. To customize the errors styles please run `rails g devise:views` and modify the `devise/shared/error_messages` partial. We will render the resource errors instead fo calling the deprecated method. --- app/views/users/registrations/delete_form.html.erb | 2 +- app/views/users/registrations/edit.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/users/registrations/delete_form.html.erb b/app/views/users/registrations/delete_form.html.erb index c52b85638..0da21e44e 100644 --- a/app/views/users/registrations/delete_form.html.erb +++ b/app/views/users/registrations/delete_form.html.erb @@ -5,7 +5,7 @@ <%= form_for(resource, as: resource_name, url: users_registrations_path, html: { method: :delete }) do |f| %> - <%= devise_error_messages! %> + <%= render "shared/errors", resource: resource %>
<%= t("devise_views.users.registrations.delete_form.info") %> diff --git a/app/views/users/registrations/edit.html.erb b/app/views/users/registrations/edit.html.erb index 4dcc388b2..b02fbda8f 100644 --- a/app/views/users/registrations/edit.html.erb +++ b/app/views/users/registrations/edit.html.erb @@ -3,7 +3,7 @@

<%= t("devise_views.users.registrations.edit.edit") %>

<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %> - <%= devise_error_messages! %> + <%= render "shared/errors", resource: resource %>
<%= f.label :email, t("devise_views.users.registrations.edit.email_label") %> From c9752e94bed696f2d76f3448565ead07b045668d Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Thu, 4 Apr 2019 16:40:26 +0200 Subject: [PATCH 100/104] Change the way we retrireve the images urls For some reason the paperclip method `attachment.exists?' was returning nil even when `attachment.url(style)' was correctly returning the url/path of the attachment. Therefore returning `nil' was causing to raise an error in the method `image_tag'. With this change we make sure we return the image url it it's available, or an empty string if it's not, but never a null value. --- app/models/concerns/galleryable.rb | 4 ++-- app/models/concerns/imageable.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/models/concerns/galleryable.rb b/app/models/concerns/galleryable.rb index 1063c5571..5ddf322f6 100644 --- a/app/models/concerns/galleryable.rb +++ b/app/models/concerns/galleryable.rb @@ -6,7 +6,7 @@ module Galleryable accepts_nested_attributes_for :images, allow_destroy: true, update_only: true def image_url(style) - image.attachment.url(style) if image && image.attachment.exists? + image&.attachment&.url(style) || "" end end -end \ No newline at end of file +end diff --git a/app/models/concerns/imageable.rb b/app/models/concerns/imageable.rb index 727ff9a6b..3e3b15685 100644 --- a/app/models/concerns/imageable.rb +++ b/app/models/concerns/imageable.rb @@ -6,7 +6,7 @@ module Imageable accepts_nested_attributes_for :image, allow_destroy: true, update_only: true def image_url(style) - image.attachment.url(style) if image && image.attachment.exists? + image&.attachment&.url(style) || "" end end end From b36fdb560407b72dc464c9026a54fdfed6e0b2cd Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Thu, 4 Apr 2019 16:48:32 +0200 Subject: [PATCH 101/104] Add lib folder path to eager_load_paths Because autoloading is disabled in production with Rails 5, using autoload_paths will not load needed classes from specified paths. The solution to this, is to ask Rails to eager load classes. https://sipsandbits.com/2017/02/14/upgrading-a-ruby-on-rails-application/ --- config/environments/preproduction.rb | 5 +++++ config/environments/production.rb | 5 +++++ config/environments/staging.rb | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/config/environments/preproduction.rb b/config/environments/preproduction.rb index 243d7ffef..5dfdcacd6 100644 --- a/config/environments/preproduction.rb +++ b/config/environments/preproduction.rb @@ -10,6 +10,11 @@ Rails.application.configure do # Rake tasks automatically ignore this option for performance. config.eager_load = true + # Because autoloading is disabled in production environments with Rails 5, + # using autoload_paths will not load needed classes from specified paths. + # The solution to this, is to ask Rails to eager load classes. + config.eager_load_paths << "#{config.root}/lib" + # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true diff --git a/config/environments/production.rb b/config/environments/production.rb index 680a3b29a..d66dd3b3d 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -10,6 +10,11 @@ Rails.application.configure do # Rake tasks automatically ignore this option for performance. config.eager_load = true + # Because autoloading is disabled in production environments with Rails 5, + # using autoload_paths will not load needed classes from specified paths. + # The solution to this, is to ask Rails to eager load classes. + config.eager_load_paths << "#{config.root}/lib" + # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true diff --git a/config/environments/staging.rb b/config/environments/staging.rb index 7bd4f8aa9..5a47275cc 100644 --- a/config/environments/staging.rb +++ b/config/environments/staging.rb @@ -10,6 +10,11 @@ Rails.application.configure do # Rake tasks automatically ignore this option for performance. config.eager_load = true + # Because autoloading is disabled in production environments with Rails 5, + # using autoload_paths will not load needed classes from specified paths. + # The solution to this, is to ask Rails to eager load classes. + config.eager_load_paths << "#{config.root}/lib" + # Full error reports are disabled and caching is turned on. config.consider_all_requests_local = false config.action_controller.perform_caching = true From 97974a8bc7b8e29f0dc5e319e6f8484aea8a4bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Mon, 28 Jan 2019 23:12:09 +0100 Subject: [PATCH 102/104] Set globalize fallbacks for requests New version of globalize uses RequestStore gem to store I18n.locale and Globalize.fallbacks in a per request basis to avoid collissions between different requests. This gem update broke Globalize.fallback results because it tries to fetch fallbacks from RequestStore, where there is no locale fallbacks definition. --- app/controllers/application_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5df842899..38ce20f34 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -10,6 +10,7 @@ class ApplicationController < ActionController::Base before_action :set_locale before_action :track_email_campaign before_action :set_return_url + before_action :set_fallbacks_to_all_available_locales check_authorization unless: :devise_controller? self.responder = ApplicationResponder @@ -128,4 +129,8 @@ class ApplicationController < ActionController::Base def current_budget Budget.current end + + def set_fallbacks_to_all_available_locales + Globalize.set_fallbacks_to_all_available_locales + end end From 58b9899406be21edb46b0801065b20594b6f041e Mon Sep 17 00:00:00 2001 From: Julian Herrero Date: Fri, 5 Apr 2019 13:07:11 +0200 Subject: [PATCH 103/104] Require conflicting dependencies spec/lib/tasks/dev_seed_spec.rb:8 This test was failing and we could see messages like: db/dev_seeds/polls.rb:147: warning: toplevel constant Answer referenced by Poll::Answer Resulting in the error: rake db:dev_seed seeds the database without errors Failure/Error: expect { run_rake_task }.not_to raise_error expected no Exception, got # Date: Tue, 16 Apr 2019 17:05:04 +0200 Subject: [PATCH 104/104] Prepend custom assets to CONSUL assets Rails 5 changed the initialization order, and now our initializers were running before the `append_assets_path` initializer for each engine, which prepended application assets to the custom assets we prepended in the initializer. Moving the code to the `config.after_initialize` code didn't work either, since the paths added there were ignored by the application. Adding another initializer to the Rails Engine is a hack, but solves the problem. --- config/application.rb | 10 ++++++++++ config/initializers/assets.rb | 5 ----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/config/application.rb b/config/application.rb index f4345061a..6ef88f5ea 100644 --- a/config/application.rb +++ b/config/application.rb @@ -71,4 +71,14 @@ module Consul end end +class Rails::Engine + initializer :prepend_custom_assets_path, group: :all do |app| + if self.class.name == "Consul::Application" + %w[images fonts javascripts].each do |asset| + app.config.assets.paths.unshift(Rails.root.join("app", "assets", asset, "custom").to_s) + end + end + end +end + require "./config/application_custom.rb" diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb index cbd07efbf..4990ba4d0 100644 --- a/config/initializers/assets.rb +++ b/config/initializers/assets.rb @@ -16,8 +16,3 @@ Rails.application.config.assets.precompile += %w( print.css ) Rails.application.config.assets.precompile += %w( ie.css ) # Loads custom images and custom fonts before app/assets/images and app/assets/fonts -assets_path = Rails.application.config.assets.paths - -%w[images fonts javascripts].each do |asset| - assets_path.insert(0, Rails.root.join("app", "assets", asset, "custom").to_s) -end