diff --git a/Gemfile b/Gemfile index cb3135b..b02355a 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,6 @@ source 'https://rubygems.org' ruby '3.3.5' -gem 'acts-as-taggable-on' gem 'bootsnap', require: false gem 'csv' gem 'importmap-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 35e8250..34cdc5f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -72,9 +72,6 @@ GEM minitest (>= 5.1) securerandom (>= 0.3) tzinfo (~> 2.0, >= 2.0.5) - acts-as-taggable-on (11.0.0) - activerecord (>= 7.0, < 8.0) - zeitwerk (>= 2.4, < 3.0) ast (2.4.2) babel-source (5.8.35) babel-transpiler (0.7.0) @@ -315,7 +312,6 @@ PLATFORMS x86_64-linux DEPENDENCIES - acts-as-taggable-on bootsnap csv debug diff --git a/app/models/guest.rb b/app/models/guest.rb index 412f01c..39d27b3 100644 --- a/app/models/guest.rb +++ b/app/models/guest.rb @@ -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: { diff --git a/db/migrate/20241101181052_drop_taggable_tables.rb b/db/migrate/20241101181052_drop_taggable_tables.rb new file mode 100644 index 0000000..cce88c7 --- /dev/null +++ b/db/migrate/20241101181052_drop_taggable_tables.rb @@ -0,0 +1,37 @@ +# Copyright (C) 2024 Manuel Bustillo + +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 + + drop_table "tags", force: :cascade do |t| + t.string "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "taggings_count", default: 0 + t.index ["name"], name: "index_tags_on_name", unique: true + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 1c81149..172be0b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -12,7 +12,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,40 +67,8 @@ 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 - t.datetime "updated_at", null: false - t.integer "taggings_count", default: 0 - t.index ["name"], name: "index_tags_on_name", unique: true - end - add_foreign_key "groups", "groups", column: "parent_id" 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 diff --git a/db/seeds.rb b/db/seeds.rb index 09d33f7..71b2a31 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -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')