From 44d3c84e137fa0cd0027e3c1e8b6ff1192583911 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Thu, 16 Oct 2025 17:32:05 +0200 Subject: [PATCH] Revert "Don't relay name change events to the timeline" This reverts commit fc0b59267e6a34772e9345a4f89a022a3cc2a175. --- app/models/user/day_timeline.rb | 19 +--- app/models/webhook.rb | 1 + ...collection_id_and_action_and_created_at.rb | 5 - db/schema.rb | 7 +- db/schema_cache.yml | 102 +++++------------- 5 files changed, 28 insertions(+), 106 deletions(-) delete mode 100644 db/migrate/20251016153034_add_index_to_events_on_collection_id_and_action_and_created_at.rb diff --git a/app/models/user/day_timeline.rb b/app/models/user/day_timeline.rb index 6ca015a0f..cf8d08612 100644 --- a/app/models/user/day_timeline.rb +++ b/app/models/user/day_timeline.rb @@ -50,35 +50,18 @@ class User::DayTimeline end private - TIMELINEABLE_ACTIONS = %w[ - card_assigned - card_unassigned - card_published - card_closed - card_reopened - card_due_date_added - card_due_date_changed - card_due_date_removed - card_collection_changed - comment_created - ] - def first_day_with_activity_this_week? day.monday? || (earliest_time.present? && earliest_time < day.beginning_of_week(:monday)) end def filtered_events @filtered_events ||= begin - events = timelineable_events.where(collection: collections) + events = Event.where(collection: collections) events = events.where(creator_id: filter.creators.ids) if filter.creators.present? events end end - def timelineable_events - Event.where(action: TIMELINEABLE_ACTIONS) - end - def collections filter.collections.presence || user.collections end diff --git a/app/models/webhook.rb b/app/models/webhook.rb index d3411e974..a766e68f5 100644 --- a/app/models/webhook.rb +++ b/app/models/webhook.rb @@ -15,6 +15,7 @@ class Webhook < ApplicationRecord card_due_date_removed card_published card_reopened + card_title_changed card_unassigned card_unstaged comment_created diff --git a/db/migrate/20251016153034_add_index_to_events_on_collection_id_and_action_and_created_at.rb b/db/migrate/20251016153034_add_index_to_events_on_collection_id_and_action_and_created_at.rb deleted file mode 100644 index 1ffe58d7d..000000000 --- a/db/migrate/20251016153034_add_index_to_events_on_collection_id_and_action_and_created_at.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddIndexToEventsOnCollectionIdAndActionAndCreatedAt < ActiveRecord::Migration[8.1] - def change - add_index :events, [ :collection_id, :action, :created_at ], name: "index_events_on_collection_id_and_action_and_created_at" - end -end diff --git a/db/schema.rb b/db/schema.rb index 2ae9fd73e..b6d4d1ffe 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[8.1].define(version: 2025_10_16_153034) do +ActiveRecord::Schema[8.1].define(version: 2025_10_15_123003) do create_table "accesses", force: :cascade do |t| t.datetime "accessed_at" t.integer "collection_id", null: false @@ -272,7 +272,6 @@ ActiveRecord::Schema[8.1].define(version: 2025_10_16_153034) do t.json "particulars", default: {} t.datetime "updated_at", null: false t.index ["action"], name: "index_events_on_summary_id_and_action" - t.index ["collection_id", "action", "created_at"], name: "index_events_on_collection_id_and_action_and_created_at" t.index ["collection_id"], name: "index_events_on_collection_id" t.index ["creator_id"], name: "index_events_on_creator_id" t.index ["eventable_type", "eventable_id"], name: "index_events_on_eventable" @@ -404,10 +403,6 @@ ActiveRecord::Schema[8.1].define(version: 2025_10_16_153034) do t.index ["user_id"], name: "index_sessions_on_user_id" end -# Could not dump table "sqlite_stat1" because of following StandardError -# Unknown type '' for column 'idx' - - create_table "steps", force: :cascade do |t| t.integer "card_id", null: false t.boolean "completed", default: false, null: false diff --git a/db/schema_cache.yml b/db/schema_cache.yml index b4e6b25f2..68e51777c 100644 --- a/db/schema_cache.yml +++ b/db/schema_cache.yml @@ -474,12 +474,12 @@ columns: - !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column auto_increment: name: due_on - cast_type: &40 !ruby/object:ActiveRecord::Type::Date + cast_type: &38 !ruby/object:ActiveRecord::Type::Date precision: scale: limit: timezone: - sql_type_metadata: &41 !ruby/object:ActiveRecord::ConnectionAdapters::SqlTypeMetadata + sql_type_metadata: &39 !ruby/object:ActiveRecord::ConnectionAdapters::SqlTypeMetadata sql_type: date type: :date limit: @@ -511,7 +511,7 @@ columns: default_function: collation: comment: - - &39 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column + - &37 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column auto_increment: name: title cast_type: *7 @@ -583,11 +583,11 @@ columns: - !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column auto_increment: name: all_access - cast_type: &35 !ruby/object:ActiveModel::Type::Boolean + cast_type: &33 !ruby/object:ActiveModel::Type::Boolean precision: scale: limit: - sql_type_metadata: &36 !ruby/object:ActiveRecord::ConnectionAdapters::SqlTypeMetadata + sql_type_metadata: &34 !ruby/object:ActiveRecord::ConnectionAdapters::SqlTypeMetadata sql_type: boolean type: :boolean limit: @@ -865,7 +865,7 @@ columns: - *9 filters_tags: - *20 - - &38 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column + - &36 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column auto_increment: name: tag_id cast_type: *3 @@ -982,7 +982,7 @@ columns: - *9 - *18 period_highlights: - - &37 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column + - &35 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column auto_increment: name: content cast_type: *15 @@ -1107,11 +1107,11 @@ columns: - !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column auto_increment: name: rowid - cast_type: &33 !ruby/object:ActiveModel::Type::Value + cast_type: !ruby/object:ActiveModel::Type::Value precision: scale: limit: - sql_type_metadata: &34 !ruby/object:ActiveRecord::ConnectionAdapters::SqlTypeMetadata + sql_type_metadata: !ruby/object:ActiveRecord::ConnectionAdapters::SqlTypeMetadata sql_type: '' type: limit: @@ -1185,50 +1185,19 @@ columns: - *9 - *32 - *18 - sqlite_stat1: - - !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column - auto_increment: - name: idx - cast_type: *33 - sql_type_metadata: *34 - 'null': true - default: - default_function: - collation: - comment: - - !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column - auto_increment: - name: stat - cast_type: *33 - sql_type_metadata: *34 - 'null': true - default: - default_function: - collation: - comment: - - !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column - auto_increment: - name: tbl - cast_type: *33 - sql_type_metadata: *34 - 'null': true - default: - default_function: - collation: - comment: steps: - *23 - !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column auto_increment: name: completed - cast_type: *35 - sql_type_metadata: *36 + cast_type: *33 + sql_type_metadata: *34 'null': false default: false default_function: collation: comment: - - *37 + - *35 - *5 - *6 - *9 @@ -1236,12 +1205,12 @@ columns: - *23 - *5 - *6 - - *38 + - *36 - *9 tags: - *5 - *6 - - *39 + - *37 - *9 user_settings: - !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column @@ -1284,8 +1253,8 @@ columns: - !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column auto_increment: name: starts_at - cast_type: *40 - sql_type_metadata: *41 + cast_type: *38 + sql_type_metadata: *39 'null': false default: default_function: @@ -1294,11 +1263,11 @@ columns: - *9 - *18 users: - - &43 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column + - &41 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column auto_increment: name: active - cast_type: *35 - sql_type_metadata: *36 + cast_type: *33 + sql_type_metadata: *34 'null': false default: true default_function: @@ -1347,8 +1316,8 @@ columns: - !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column auto_increment: name: watching - cast_type: *35 - sql_type_metadata: *36 + cast_type: *33 + sql_type_metadata: *34 'null': false default: true default_function: @@ -1378,7 +1347,7 @@ columns: comment: - *6 - *9 - - &42 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column + - &40 !ruby/object:ActiveRecord::ConnectionAdapters::SQLite3::Column auto_increment: name: webhook_id cast_type: *3 @@ -1432,9 +1401,9 @@ columns: collation: comment: - *9 - - *42 + - *40 webhooks: - - *43 + - *41 - *24 - *5 - *6 @@ -1523,7 +1492,6 @@ primary_keys: search_queries: id search_results: id sessions: id - sqlite_stat1: steps: id taggings: id tags: id @@ -1578,7 +1546,6 @@ data_sources: search_queries: true search_results: true sessions: true - sqlite_stat1: true steps: true taggings: true tags: true @@ -2384,24 +2351,6 @@ indexes: nulls_not_distinct: comment: valid: true - - !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition - table: events - name: index_events_on_collection_id_and_action_and_created_at - unique: false - columns: - - collection_id - - action - - created_at - lengths: {} - orders: {} - opclasses: {} - where: - type: - using: - include: - nulls_not_distinct: - comment: - valid: true - !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition table: events name: index_events_on_creator_id @@ -2930,7 +2879,6 @@ indexes: nulls_not_distinct: comment: valid: true - sqlite_stat1: [] steps: - !ruby/object:ActiveRecord::ConnectionAdapters::IndexDefinition table: steps @@ -3249,4 +3197,4 @@ indexes: nulls_not_distinct: comment: valid: true -version: 20251016153034 +version: 20251015123003