Closed leehericks closed 5 years ago
Thanks for the bug report.
Indeed, it seems the sort params are being actively ignored when .limit(1)
is used. Bad idea. I'll push a fix shortly.
Just released v0.2.1 with a fix.
4e2a6fc9dd156a1702afdd48b4530759953b002f Don't ignore .sort params when .limit(1) is used 80094a815ff2c63282c9a8a7872754872ba49aa4 Bump version to 0.2.1
@leehericks Please confirm this fixes it for you if you could.
Gem updated, tested and confirmed fixed! Thank you!
I'm attempting to retrieve the latest "Term" from our FileMaker database by sorting the records by the term's end date descending and then retrieving the first record.
Doing a limit of 2 results in the sort working and the most recent two records being returned.
But calling a limit of 1 and find_some or simply calling find_one does not attach the sort params although they exist in the Spyke Relation.
I have not been able to find a place in the source code where limit(1) or find_one would be ignoring the sort params.