From 184d5fc504e30649a08e1af61d9e2d8abe14fbaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 31 Oct 2019 18:23:59 +0100 Subject: [PATCH] Remove unused model It was added in commit 74083df1; we're not sure why. --- app/models/budget_rol_assignment.rb | 4 ---- app/models/user.rb | 2 -- .../20191031172132_drop_budget_rol_assignments.rb | 9 +++++++++ db/schema.rb | 14 +------------- 4 files changed, 10 insertions(+), 19 deletions(-) delete mode 100644 app/models/budget_rol_assignment.rb create mode 100644 db/migrate/20191031172132_drop_budget_rol_assignments.rb diff --git a/app/models/budget_rol_assignment.rb b/app/models/budget_rol_assignment.rb deleted file mode 100644 index 5242ae5c9..000000000 --- a/app/models/budget_rol_assignment.rb +++ /dev/null @@ -1,4 +0,0 @@ -class BudgetRolAssignment < ApplicationRecord - belongs_to :budget - belongs_to :user -end diff --git a/app/models/user.rb b/app/models/user.rb index 6533aaded..a2afcf858 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -45,7 +45,6 @@ class User < ApplicationRecord inverse_of: :receiver has_many :legislation_answers, class_name: "Legislation::Answer", dependent: :destroy, inverse_of: :user has_many :follows - has_many :budget_rol_assignments has_many :legislation_annotations, class_name: "Legislation::Annotation", foreign_key: :author_id, @@ -80,7 +79,6 @@ class User < ApplicationRecord foreign_key: :author_id, inverse_of: :author has_many :topics, foreign_key: :author_id, inverse_of: :author - has_many :budgets, through: :budget_rol_assignments belongs_to :geozone validates :username, presence: true, if: :username_required? diff --git a/db/migrate/20191031172132_drop_budget_rol_assignments.rb b/db/migrate/20191031172132_drop_budget_rol_assignments.rb new file mode 100644 index 000000000..b97c61ddc --- /dev/null +++ b/db/migrate/20191031172132_drop_budget_rol_assignments.rb @@ -0,0 +1,9 @@ +class DropBudgetRolAssignments < ActiveRecord::Migration[5.0] + def up + drop_table :budget_rol_assignments + end + + def down + fail ActiveRecord::IrreversibleMigration + end +end diff --git a/db/schema.rb b/db/schema.rb index 7400cc80f..3d88ed7a7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20191030160347) do +ActiveRecord::Schema.define(version: 20191031172132) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -340,16 +340,6 @@ ActiveRecord::Schema.define(version: 20191030160347) do t.datetime "updated_at", null: false end - create_table "budget_rol_assignments", force: :cascade do |t| - t.integer "budget_id" - t.integer "user_id" - t.string "rol" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.index ["budget_id"], name: "index_budget_rol_assignments_on_budget_id", using: :btree - t.index ["user_id"], name: "index_budget_rol_assignments_on_user_id", using: :btree - end - create_table "budget_tracker_assignments", force: :cascade do |t| t.integer "tracker_id" t.integer "investment_id" @@ -1713,8 +1703,6 @@ ActiveRecord::Schema.define(version: 20191030160347) do add_foreign_key "budget_administrators", "administrators" add_foreign_key "budget_administrators", "budgets" add_foreign_key "budget_investments", "communities" - add_foreign_key "budget_rol_assignments", "budgets" - add_foreign_key "budget_rol_assignments", "users" add_foreign_key "budget_tracker_assignments", "trackers" add_foreign_key "budget_trackers", "budgets" add_foreign_key "budget_trackers", "trackers"