Skip to content

Conversation

@polecpiotr
Copy link

Hello
I've been using active graph for some time and one thing that bothered me from the start was the absence of finder methods like second or third. This PR aims to add them. I've taken inspiration from rails repository

This pull introduces/changes:

  • Adds second, third, fourth and fifth methods to query records 'from the start'
  • Adds second_to_last and third_to_last methods to query records 'from the end'
  • Adds optional argument limit to first and last methods to return more than one record

In find_nth, conditional is necessary. If we have only one branch and always use limit, in the case of limit = 1 it doesn't work. first(1) returns one record as an array, not a singular object.

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.

1 participant