Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch oldest authored_at correctly instead of oldest authored_at per page #4460

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Commits on Feb 20, 2024

  1. Fetch oldest authored_at correctly instead of oldest authored_at per …

    …page
    
    Fixes rubygems#4448
    
    Previously, the "since date" was using oldest `version.authored_at` for a given
    page. This change fixes it to get the oldest `version.authored_at` in
    the database. Because `authored_at` depends on either `built_at` or
    `created_at`, I fetch both and take the min. This should only be 2
    additional queries of 1 record each.
    
    I modified existing tests to check for the "versions since" text and
    also have 2 pages of actual content.
    albertchae committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    ade3eaf View commit details
    Browse the repository at this point in the history
  2. Add oldest_authored_at scope to Version

    Replicate `Version#authored_at` logic in a SQL case statement and call
    SQL `minimum` on that to get the oldest `authored_at`
    
    Add tests for the model using similar structure as tests for `authored_at`
    albertchae committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    b146132 View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2024

  1. Remove unnecessary in_time_zone and make oldest_authored_at a class m…

    …ethod
    
    Also now that `.oldest_authored_at` is a class method and not a scope,
    moved it next to `#authored_at
    albertchae committed Feb 22, 2024
    Configuration menu
    Copy the full SHA
    c26f464 View commit details
    Browse the repository at this point in the history