-
-
Save sevenseacat/9e729f2d5186b0d1f829 to your computer and use it in GitHub Desktop.
This file contains 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
filters = {} | |
filters[:name] = params[:name] if params[:name] | |
filters[:age] = params[:age] if params[:age] | |
filters[:gender] = params[:gender] if params[:gender] | |
# or some computation or other process for each field here instead, to mimic functionality that a simple slice wouldnt replicate | |
Person.where(filters) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment