-
Notifications
You must be signed in to change notification settings - Fork 230
Conversation
Nice. Just one thing... Please add tests for this new functionality into the WhereBlock tests inside blocks.test.coffee. That's where the tests for this should really sit. |
Moved and added more tests at the right place. |
The tests are in the right place now but it would be better if they tested the calls made to both If you If you're not sure how to do this then just leave things as they are and I'll rewrite the test code once I've merged. Thanks. |
Updated |
That looks great. Just one last thing... in the substitutes variadic arguments test you've added please assert at the end that |
Ah, one more small change on this line: https://github.com/diwu1989/squel/commit/1739d9ad93a87174dbca87c615f0b6b2d1f991f3#L0R720 Set the stub to |
Updated and squashed all changes related to this feature |
Thanks. |
Adding where parameter substitution
Changes Unknown when pulling 5aa852a on diwu1989:whereClause into * on hiddentao:master*. |
Allow the use of .where(condition, val1, val2, val3, ...) for parameter substitution.
example:
.where('a = ?', 'hello world')
--- where a = 'hello world'
.where('a in ?', [1,2,3])
--- where a in (1, 2, 3)
.where('a in ? and b = ?', ['x', 'y'], 123)
--- where a in ('x', 'y') and b = 123