Last active
September 2, 2020 07:39
-
-
Save vilusa/20448f6601a561da9e315aa4dec2955d to your computer and use it in GitHub Desktop.
query present helper
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def query_present?(array) | |
| query = params[:q] | |
| return false if query.nil? | |
| query = query.permit!.to_h | |
| query.any? do |key, value| | |
| key.to_s.in?(array) && value.present? | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment