Files
once-campfire/app/controllers/rooms/refreshes_controller.rb
T
David Heinemeier Hansson 659f95748a Preload only uncached messages and reduce rendering overhead (#292)
* Preload only uncached messages and reduce rendering overhead

* Keep benchmark summaries without raw JSON results

* Use Ruby benchmark drivers and keep generated results out of the repo
2026-10-04 12:36:36 -04:00

16 lines
463 B
Ruby

class Rooms::RefreshesController < ApplicationController
include RoomScoped
before_action :set_last_updated_at
def show
@new_messages = @room.messages.with_presentation.page_created_since(@last_updated_at)
@updated_messages = @room.messages.without(@new_messages).with_presentation.page_updated_since(@last_updated_at)
end
private
def set_last_updated_at
@last_updated_at = Time.at(0, params[:since].to_i, :millisecond)
end
end