Revert "Don't relay name change events to the timeline"

This reverts commit fc0b59267e.
This commit is contained in:
Jorge Manrubia
2025-10-16 17:32:05 +02:00
parent fc0b59267e
commit 44d3c84e13
5 changed files with 28 additions and 106 deletions
+1 -18
View File
@@ -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
+1
View File
@@ -15,6 +15,7 @@ class Webhook < ApplicationRecord
card_due_date_removed
card_published
card_reopened
card_title_changed
card_unassigned
card_unstaged
comment_created
@@ -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
Generated
+1 -6
View File
@@ -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
+25 -77
View File
@@ -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