-
-
Notifications
You must be signed in to change notification settings - Fork 810
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
Allow creating aliases for ransack attributes #623
Conversation
@@ -33,6 +33,14 @@ def quote_column_name name | |||
end | |||
|
|||
module ClassMethods | |||
def _ransack_aliases | |||
@_ransack_alises ||= {} |
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.
Looks like a typo here. It did not cause the specs to fail?
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.
Definitely a typo, but that variable is always being accessed through it's reader, which is why the tests pass anyway.
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.
Oh right, memoization. Thanks.
Thanks for the PR! Will test it locally soon. |
Hey @jonatack, I fixed that typo. Have you had a chance to take a look? |
Allow creating aliases for ransack attributes.
LGTM, thanks @rzane. Could you update the README and Change Log to document this change? |
Sure. I'll do that right now. |
Great. |
[skip ci] Document the use of ransack_alias. Follow-up to #623.
I have been excited for this change since I spotted it a month ago. Do you have an ETA for when this will be released? |
Hi @lauramosher, you can use all the latest features with the master branch. We do need to do a release soon but there are a couple of issues to iron out before... |
@jonatack Thank you for the reply! Unfortunately, I am unable to use the master branch in this instance, but greatly look forward to the release. Keep up the awesome work. |
Looks great! Anything I can do to help move this into a release? Thank you! 👏 |
Ransack is great, but the query strings can get crazy pretty quickly, especially when querying associations. It would be really great to have aliases for ransack attributes.
It seems like people want this feature built into Ransack. See:
This PR allows you to do this: