Have you ever come across a Ruby on Rails query that has so many conditions that it's hard to figure out what is being replaced where? While this can be somewhat mitigated by using Rails named scopes, you can also use named bind variables to make it easier to read. Named bind variables replace the question marks with symbols and you supply a hash with values for the matching symbol keys:
This is also very handy when you have the same value for multiple parameters, since it will replace all matching bind variables with the value (e.g., the current time).
Need web application development, maintenance for your existing app, or a third party code review?
Velocity Labs can help.Hire us!