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

Update the pager object with fresh dataset before returning #403

Open
wants to merge 2 commits into
base: release-3.5
Choose a base branch
from

Commits on Oct 13, 2021

  1. Update the pager object with fresh dataset before return

    Pager object was keeping reference to old dataset in situations when
    some additionap predicated were called after using #page or #per_page
    methods, e.g.:
    
    ```
    users.page(2).where(active: true)
    ```
    
    In the example above, pager was still holding reference to a dataset not
    having active=true condition set. This resulted in a correct dataset
    being returned, but the pager methods like #total_pages returning wrong
    results.
    
    In this commit, a new public method #pager is created which shadows
    regular usage from dry-initialize by firstly update the pager with fresh
    dataset, so the calculations are correct.
    katafrakt committed Oct 13, 2021
    Configuration menu
    Copy the full SHA
    aa8778c View commit details
    Browse the repository at this point in the history

Commits on Oct 14, 2021

  1. Configuration menu
    Copy the full SHA
    bad3047 View commit details
    Browse the repository at this point in the history