Remove engagements

We are not using this anymore!
This commit is contained in:
Jorge Manrubia
2025-12-19 13:10:11 +01:00
committed by Jorge Manrubia
parent e34716a537
commit 6d05ab428e
6 changed files with 18 additions and 50 deletions
@@ -1,18 +0,0 @@
class Cards::EngagementsController < ApplicationController
include CardScoped
def create
case params[:engagement]
when "doing"
@card.engage
when "on_deck"
@card.move_to_on_deck
end
render_card_replacement
end
def destroy
@card.reconsider
render_card_replacement
end
end
-6
View File
@@ -1,6 +0,0 @@
class Card::Engagement < ApplicationRecord
belongs_to :account, default: -> { card.account }
belongs_to :card, class_name: "::Card", touch: true
validates :status, presence: true, inclusion: { in: %w[doing on_deck] }
end
@@ -0,0 +1,16 @@
class DropCardEngagements < ActiveRecord::Migration[8.2]
def up
drop_table :card_engagements
end
def down
create_table :card_engagements, id: :uuid do |t|
t.references :account, type: :uuid, null: false
t.references :card, type: :uuid, null: false, index: true
t.string :status, null: false
t.timestamps
end
add_index :card_engagements, [ :account_id, :status ]
end
end
Generated
+1 -11
View File
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.2].define(version: 2025_12_10_054934) do
ActiveRecord::Schema[8.2].define(version: 2025_12_19_120755) do
create_table "accesses", id: :uuid, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.datetime "accessed_at"
t.uuid "account_id", null: false
@@ -169,16 +169,6 @@ ActiveRecord::Schema[8.2].define(version: 2025_12_10_054934) do
t.index ["card_id"], name: "index_card_activity_spikes_on_card_id", unique: true
end
create_table "card_engagements", id: :uuid, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.uuid "account_id", null: false
t.uuid "card_id"
t.datetime "created_at", null: false
t.string "status", default: "doing", null: false
t.datetime "updated_at", null: false
t.index ["account_id", "status"], name: "index_card_engagements_on_account_id_and_status"
t.index ["card_id"], name: "index_card_engagements_on_card_id"
end
create_table "card_goldnesses", id: :uuid, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.uuid "account_id", null: false
t.uuid "card_id", null: false
+1 -11
View File
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.2].define(version: 2025_12_10_054934) do
ActiveRecord::Schema[8.2].define(version: 2025_12_19_120755) do
create_table "accesses", id: :uuid, force: :cascade do |t|
t.datetime "accessed_at"
t.uuid "account_id", null: false
@@ -169,16 +169,6 @@ ActiveRecord::Schema[8.2].define(version: 2025_12_10_054934) do
t.index ["card_id"], name: "index_card_activity_spikes_on_card_id", unique: true
end
create_table "card_engagements", id: :uuid, force: :cascade do |t|
t.uuid "account_id", null: false
t.uuid "card_id"
t.datetime "created_at", null: false
t.string "status", limit: 255, default: "doing", null: false
t.datetime "updated_at", null: false
t.index ["account_id", "status"], name: "index_card_engagements_on_account_id_and_status"
t.index ["card_id"], name: "index_card_engagements_on_card_id"
end
create_table "card_goldnesses", id: :uuid, force: :cascade do |t|
t.uuid "account_id", null: false
t.uuid "card_id", null: false
-4
View File
@@ -1,4 +0,0 @@
logo:
id: <%= ActiveRecord::FixtureSet.identify("logo_engagement", :uuid) %>
account: 37s_uuid
card: logo_uuid