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

mongoid7x: fix #first/last on 7.5 #627

Merged
merged 1 commit into from
Nov 17, 2022

Conversation

cyd886
Copy link

@cyd886 cyd886 commented Nov 16, 2022

Mongoid 7.5 deprecates the :id_sort keyword argument for the Criteria#first and Criteria#last methods.

If you use bullet gem along with Mongoid 7.5 or newer version, calling first() or last() method will raise an error that is caused by the parameter's default value change.

Model.where(condition).first => KeyError

This PR fix the problem and support new first/last change on Mongoid 7.5

Reference: https://www.mongodb.com/docs/mongoid/current/release-notes/mongoid-7.5/#deprecate-id-sort-option-and-support-limit-on-first-last

@flyerhzm flyerhzm merged commit cad26c6 into flyerhzm:master Nov 17, 2022
@flyerhzm
Copy link
Owner

@cyd886 thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants