-
-
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
Add feature to allow selectively skipping scope argument sanitization. #933
Add feature to allow selectively skipping scope argument sanitization. #933
Conversation
CHANGELOG.md
Outdated
@@ -1,5 +1,14 @@ | |||
# Change Log | |||
|
|||
## Version | |||
|
|||
### Added |
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.
You can leave this one out.
CHANGELOG.md
Outdated
|
||
* Add the ability to skip arg sanitization on a per scope basis. Using | ||
`ransackable_scopes_skip_sanitize_args`, users can define a list of | ||
scopes which will bypass parameter sanitization. This allows passing 0, |
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.
There is an extra space before This allows
@@ -64,6 +64,14 @@ def ransackable_scopes(auth_object = nil) | |||
[] | |||
end | |||
|
|||
# ransack_scope_skip_sanitize_args, by efault, returns an empty array. |
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.
there is a typo at by default
@justinh24 Thanks for your contribution! It is looking good to me, I just found a few copy issues. |
@justinh24 thanks! Could you please squash the 2 commits and I will merge it, thank you! |
f1e65ba
to
b006677
Compare
Fixed copy issues
b006677
to
24a4d43
Compare
@gregmolnar Sorry about forgetting to squash. Hopefully this will be good now. Thanks! |
Hmm.. there were no changes other than merges than squashing the branches. Is this a travis error? It looks like a possible timeout. |
Looks like a timeout indeed. I restarted it, let's see if that helps. |
Currently Ransack documentation suggests you implement your own sanitization if you need the ability to pass truth-y values to a scope (1,0,t,f,etc.). I have provided an add one to allow one to list scopes which should not be sanitized, and to continue using the existing mechanism for all other scopes.
This is particularly handy if you are passing form inputs into a scope. (i.e. Power Search which searches across multiple fields)