-
-
Notifications
You must be signed in to change notification settings - Fork 807
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
Search for strings containing leading whitespace is broken #1198
Comments
@DCrow that is a good point, I think the best option would be strip as default but to have a way to opt-out. |
This code could become something like: self.options = {
:search_key => :q,
:ignore_unknown_conditions => true,
:hide_sort_order_indicators => false,
:up_arrow => '▼'.freeze,
:down_arrow => '▲'.freeze,
:default_arrow => nil,
:sanitize_scope_args => true,
:postgres_fields_sort_option => nil,
:strip_whitespace => true
} Which would give the ability to do: Ransack.configure do |c|
c.strip_whitespace = false
end |
Seems good to me. Opt-out also seems logical since there might be projects which already utilize whitespace stripping. Also maybe add some notes about this change(which version started whitespace stripping, etc) and option in README? |
Closed by #1214 |
After #1115 ransack started removing whitespace from search queries.
It is now impossible to search for those kind of strings.
Some users in my project use names/label with leading spaces, so they depend on previous behavior.
Example
Maybe add some kind of option to turn off whitespace stripping?
The text was updated successfully, but these errors were encountered: