diff --git a/app/models/budget/ballot.rb b/app/models/budget/ballot.rb index 550efd345..57ea170ef 100644 --- a/app/models/budget/ballot.rb +++ b/app/models/budget/ballot.rb @@ -2,7 +2,6 @@ class Budget class Ballot < ActiveRecord::Base belongs_to :user belongs_to :budget - belongs_to :heading has_many :lines, dependent: :destroy has_many :investments, through: :lines diff --git a/app/models/budget/investment.rb b/app/models/budget/investment.rb index 6d969f226..392db0783 100644 --- a/app/models/budget/investment.rb +++ b/app/models/budget/investment.rb @@ -49,9 +49,6 @@ class Budget scope :for_render, -> { includes(heading: :geozone) } - scope :with_heading, -> { where.not(heading_id: nil) } - scope :no_heading, -> { where(heading_id: nil) } - before_save :calculate_confidence_score before_validation :set_responsible_name diff --git a/db/migrate/20160614091639_remove_heading_id_from_ballot.rb b/db/migrate/20160614091639_remove_heading_id_from_ballot.rb new file mode 100644 index 000000000..f46b93424 --- /dev/null +++ b/db/migrate/20160614091639_remove_heading_id_from_ballot.rb @@ -0,0 +1,5 @@ +class RemoveHeadingIdFromBallot < ActiveRecord::Migration + def change + remove_column :budget_ballots, :heading_id, :integer + end +end diff --git a/db/schema.rb b/db/schema.rb index 5eb4435e7..ed92d2b01 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20160610094658) do +ActiveRecord::Schema.define(version: 20160614091639) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -96,11 +96,8 @@ ActiveRecord::Schema.define(version: 20160610094658) do t.integer "budget_id" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.integer "heading_id" end - add_index "budget_ballots", ["heading_id"], name: "index_budget_ballots_on_heading_id", using: :btree - create_table "budget_groups", force: :cascade do |t| t.integer "budget_id" t.string "name", limit: 50