Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Ensure #second (and others) acts like #first AR finder #13757
This PR addresses issue #13743 where the ordinal ActiveSupport Array extentions were not assuming a default order like
As suggested by @dhh this commit brings the famous ordinal Array instance methods defined
These finders ensure a default ascending order of the table's primary key, and utilize the OFFSET SQL verb to locate the user's desired record. If an offset is defined in the query, calling #second adds
@rafaelfranca @carlosantoniodasilva @senny, commits are squashed, updated the changelog, fixed the caching issue by dynamically setting and manually memoizing the instance variable based on the offset passed in. Tested it again on several personal rails projects and the test suite looks good!
Any other feedback?