-
Notifications
You must be signed in to change notification settings - Fork 1
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
Adding order method to active query to support several argument formats #58
Adding order method to active query to support several argument formats #58
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Please update CHANGELOG.md and add this PR under "unreleased".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a little cleanup, then I'll approve.
CHANGELOG.md
Outdated
@@ -2,6 +2,11 @@ | |||
|
|||
## Not released | |||
|
|||
## 0.14.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove line 5, just leave it as "Not released". We'll package a few changes together before we release.
- Add `#order` method to active query that accepts arguments in several formats ( symbol, string that has raw soql) (https://github.com/Beyond-Finance/active_force/pull/58) | ||
- By default, the order is ascending. For descending order, you can map the column name symbol to :desc | ||
- use-cases: User.order(:name), User.order(email: :desc), User.order(:name, email: :desc), User.order('name') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove line 7&8. Just need the info on line 6.
Feel free to add info to README.md if you feel additional documentation is necessary, but since this pretty much follows the AR implementation, probably not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, Would update them
Add
order
method to active query that accepts arguments in one of several formats ( symbol, string that has raw soql):desc
Use-cases:
User.order(:name)
User.order(email: :desc)
User.order(:name, email: :desc)
User.order('name')