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

Query hash doesn't match regular expressions #369

Closed
adamgotterer opened this issue Feb 13, 2014 · 4 comments
Closed

Query hash doesn't match regular expressions #369

adamgotterer opened this issue Feb 13, 2014 · 4 comments

Comments

@adamgotterer
Copy link

.with(query: { some_field: /.*/ }) won't match

@bblimke
Copy link
Owner

bblimke commented Feb 14, 2014

Yes, it won't match. This behaviour was never implemented.

I would be happy to accept a pull request though :)

@adamgotterer
Copy link
Author

I may take a stab at that. In the interim is there a way I can just check that the param is present and not validate the data?

@bblimke
Copy link
Owner

bblimke commented Feb 15, 2014

You can either use hash including without a value .with(query: hash_including(:some_field))
or if you want to match with regexp, you can use matching block .with {|request| request.uri.query_values('some_field') =~ /.*/}

@adamgotterer
Copy link
Author

Thats helpful. Thank you.

@bblimke bblimke closed this as completed Sep 28, 2014
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

No branches or pull requests

2 participants