diff --git a/app/controllers/collections/columns/streams_controller.rb b/app/controllers/collections/columns/streams_controller.rb index 331702a92..dccc9aa15 100644 --- a/app/controllers/collections/columns/streams_controller.rb +++ b/app/controllers/collections/columns/streams_controller.rb @@ -2,7 +2,7 @@ class Collections::Columns::StreamsController < ApplicationController include CollectionScoped def show - set_page_and_extract_portion_from @collection.cards.awaiting_triage.by_last_activity.with_golden_first + set_page_and_extract_portion_from @collection.cards.awaiting_triage.latest.with_golden_first fresh_when etag: @page.records end end diff --git a/app/controllers/collections/columns_controller.rb b/app/controllers/collections/columns_controller.rb index 7cd910f01..b8f4d4de1 100644 --- a/app/controllers/collections/columns_controller.rb +++ b/app/controllers/collections/columns_controller.rb @@ -4,7 +4,7 @@ class Collections::ColumnsController < ApplicationController before_action :set_column, only: [ :show, :update, :destroy ] def show - set_page_and_extract_portion_from @column.cards.active.by_last_activity.with_golden_first + set_page_and_extract_portion_from @column.cards.active.latest.with_golden_first fresh_when etag: @page.records end diff --git a/app/controllers/collections_controller.rb b/app/controllers/collections_controller.rb index 005bf595c..cd8b69cbd 100644 --- a/app/controllers/collections_controller.rb +++ b/app/controllers/collections_controller.rb @@ -51,7 +51,7 @@ class CollectionsController < ApplicationController end def show_columns - set_page_and_extract_portion_from @collection.cards.awaiting_triage.by_last_activity.with_golden_first + set_page_and_extract_portion_from @collection.cards.awaiting_triage.latest.with_golden_first fresh_when etag: [ @collection, @page.records, @user_filtering ] end diff --git a/app/controllers/columns/cards/drops/streams_controller.rb b/app/controllers/columns/cards/drops/streams_controller.rb index f504435e6..09418133e 100644 --- a/app/controllers/columns/cards/drops/streams_controller.rb +++ b/app/controllers/columns/cards/drops/streams_controller.rb @@ -3,7 +3,7 @@ class Columns::Cards::Drops::StreamsController < ApplicationController def create @card.send_back_to_triage - set_page_and_extract_portion_from @collection.cards.awaiting_triage.by_last_activity.with_golden_first + set_page_and_extract_portion_from @collection.cards.awaiting_triage.latest.with_golden_first render turbo_stream: turbo_stream.replace("the-stream", partial: "collections/show/stream", method: :morph, locals: { collection: @card.collection, page: @page }) end diff --git a/app/controllers/public/collections/columns/streams_controller.rb b/app/controllers/public/collections/columns/streams_controller.rb index 4a38d0d08..a1fb07391 100644 --- a/app/controllers/public/collections/columns/streams_controller.rb +++ b/app/controllers/public/collections/columns/streams_controller.rb @@ -6,6 +6,6 @@ class Public::Collections::Columns::StreamsController < ApplicationController layout "public" def show - set_page_and_extract_portion_from @collection.cards.awaiting_triage.by_last_activity.with_golden_first + set_page_and_extract_portion_from @collection.cards.awaiting_triage.latest.with_golden_first end end diff --git a/app/controllers/public/collections/columns_controller.rb b/app/controllers/public/collections/columns_controller.rb index aa905f768..9f32afc1b 100644 --- a/app/controllers/public/collections/columns_controller.rb +++ b/app/controllers/public/collections/columns_controller.rb @@ -8,7 +8,7 @@ class Public::Collections::ColumnsController < ApplicationController before_action :set_column, only: :show def show - set_page_and_extract_portion_from @column.cards.active.by_last_activity.with_golden_first + set_page_and_extract_portion_from @column.cards.active.latest.with_golden_first end private diff --git a/app/controllers/public/collections_controller.rb b/app/controllers/public/collections_controller.rb index cf1530958..46fb5d750 100644 --- a/app/controllers/public/collections_controller.rb +++ b/app/controllers/public/collections_controller.rb @@ -6,6 +6,6 @@ class Public::CollectionsController < ApplicationController layout "public" def show - set_page_and_extract_portion_from @collection.cards.awaiting_triage.by_last_activity.with_golden_first + set_page_and_extract_portion_from @collection.cards.awaiting_triage.latest.with_golden_first end end diff --git a/app/models/card.rb b/app/models/card.rb index c21512848..3b455a424 100644 --- a/app/models/card.rb +++ b/app/models/card.rb @@ -16,8 +16,7 @@ class Card < ApplicationRecord scope :reverse_chronologically, -> { order created_at: :desc, id: :desc } scope :chronologically, -> { order created_at: :asc, id: :asc } - scope :latest, -> { order updated_at: :desc, id: :desc } - scope :by_last_activity, -> { order last_active_at: :desc, id: :desc } + scope :latest, -> { order last_active_at: :desc, id: :desc } scope :indexed_by, ->(index) do case index