Remove references to acts_as_taggable_on gem

This commit is contained in:
Manuel Bustillo 2024-11-01 19:12:34 +01:00 committed by bustikiller
parent ea129602b5
commit 5fef6f1011
4 changed files with 28 additions and 30 deletions

View File

@ -1,7 +1,6 @@
# Copyright (C) 2024 Manuel Bustillo
class Guest < ApplicationRecord
acts_as_taggable_on :affinity_groups, :unbreakable_bonds
belongs_to :group
enum status: {

View File

@ -0,0 +1,27 @@
class DropTaggableTables < ActiveRecord::Migration[7.2]
def change
drop_table 'taggings', force: :cascade do |t|
t.bigint 'tag_id'
t.string 'taggable_type'
t.uuid 'taggable_id'
t.string 'tagger_type'
t.bigint 'tagger_id'
t.string 'context', limit: 128
t.datetime 'created_at', precision: nil
t.string 'tenant', limit: 128
t.index ['context'], name: 'index_taggings_on_context'
t.index %w[tag_id taggable_id taggable_type context tagger_id tagger_type], name: 'taggings_idx',
unique: true
t.index ['tag_id'], name: 'index_taggings_on_tag_id'
t.index %w[taggable_id taggable_type context], name: 'taggings_taggable_context_idx'
t.index %w[taggable_id taggable_type tagger_id context], name: 'taggings_idy'
t.index ['taggable_id'], name: 'index_taggings_on_taggable_id'
t.index %w[taggable_type taggable_id], name: 'index_taggings_on_taggable_type_and_taggable_id'
t.index ['taggable_type'], name: 'index_taggings_on_taggable_type'
t.index %w[tagger_id tagger_type], name: 'index_taggings_on_tagger_id_and_tagger_type'
t.index ['tagger_id'], name: 'index_taggings_on_tagger_id'
t.index %w[tagger_type tagger_id], name: 'index_taggings_on_tagger_type_and_tagger_id'
t.index ['tenant'], name: 'index_taggings_on_tenant'
end
end
end

28
db/schema.rb generated
View File

@ -1,5 +1,3 @@
# Copyright (C) 2024 Manuel Bustillo
# 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.
@ -12,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.1].define(version: 2024_08_11_170021) do
ActiveRecord::Schema[7.2].define(version: 2024_11_01_181052) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -67,29 +65,6 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_11_170021) do
t.datetime "updated_at", null: false
end
create_table "taggings", force: :cascade do |t|
t.bigint "tag_id"
t.string "taggable_type"
t.uuid "taggable_id"
t.string "tagger_type"
t.bigint "tagger_id"
t.string "context", limit: 128
t.datetime "created_at", precision: nil
t.string "tenant", limit: 128
t.index ["context"], name: "index_taggings_on_context"
t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true
t.index ["tag_id"], name: "index_taggings_on_tag_id"
t.index ["taggable_id", "taggable_type", "context"], name: "taggings_taggable_context_idx"
t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy"
t.index ["taggable_id"], name: "index_taggings_on_taggable_id"
t.index ["taggable_type", "taggable_id"], name: "index_taggings_on_taggable_type_and_taggable_id"
t.index ["taggable_type"], name: "index_taggings_on_taggable_type"
t.index ["tagger_id", "tagger_type"], name: "index_taggings_on_tagger_id_and_tagger_type"
t.index ["tagger_id"], name: "index_taggings_on_tagger_id"
t.index ["tagger_type", "tagger_id"], name: "index_taggings_on_tagger_type_and_tagger_id"
t.index ["tenant"], name: "index_taggings_on_tenant"
end
create_table "tags", force: :cascade do |t|
t.string "name"
t.datetime "created_at", null: false
@ -102,5 +77,4 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_11_170021) do
add_foreign_key "guests", "groups"
add_foreign_key "seats", "guests"
add_foreign_key "seats", "tables_arrangements", on_delete: :cascade
add_foreign_key "taggings", "tags"
end

View File

@ -5,8 +5,6 @@ NUMBER_OF_GUESTS = 50
TablesArrangement.delete_all
Expense.delete_all
Guest.delete_all
ActsAsTaggableOn::Tagging.delete_all
ActsAsTaggableOn::Tag.delete_all
Group.delete_all
Expense.create!(name: 'Photographer', amount: 3000, pricing_type: 'fixed')