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

feat(query-builder): add last method #232

Merged
merged 6 commits into from
Nov 17, 2017

Conversation

RomainLanz
Copy link
Member

Closes #214

@thetutlage
Copy link
Member

Why latest and not last? Since we already use first

@RomainLanz
Copy link
Member Author

It feels more "English" in my head but I may be wrong!
Do you want me to update it to last?

@webdevian
Copy link
Contributor

First & Last pair nicely, the opposite of Latest would be Earliest or Oldest

@RomainLanz
Copy link
Member Author

Updated 👍

@RomainLanz RomainLanz closed this Nov 13, 2017
@RomainLanz RomainLanz reopened this Nov 13, 2017
@thetutlage thetutlage changed the title feat(query-builder): add latest method feat(query-builder): add last method Nov 13, 2017
@RomainLanz RomainLanz closed this Nov 14, 2017
@RomainLanz RomainLanz reopened this Nov 14, 2017
@coveralls
Copy link

coveralls commented Nov 14, 2017

Coverage Status

Coverage decreased (-0.1%) to 96.238% when pulling 45fe060 on RomainForks:feature/query-builder-last into fe69ed2 on adonisjs:develop.

@thetutlage
Copy link
Member

@RomainLanz Can u add the other methods too. So this is how it should be

  1. Database query builder, should have the last method and make use of id to add the orderBy clause.

  2. Model query builder should use primaryKey for the orderByClause

  3. Model static method, just calls the query builder method.

And the orderBy field can be overridden as it is in your code already

@RomainLanz
Copy link
Member Author

Should be good 👍

@coveralls
Copy link

coveralls commented Nov 17, 2017

Coverage Status

Coverage decreased (-0.08%) to 96.266% when pulling 641803e on RomainForks:feature/query-builder-last into fe69ed2 on adonisjs:develop.

@thetutlage thetutlage merged commit 01a6fa7 into adonisjs:develop Nov 17, 2017
@RomainLanz RomainLanz deleted the feature/query-builder-last branch November 17, 2017 11:20
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.

4 participants