Skip to content

Fix query interpolation - #144

Open
ruiwen wants to merge 2 commits into
brianleroux:masterfrom
ruiwen:fix_query_interpolation
Open

Fix query interpolation#144
ruiwen wants to merge 2 commits into
brianleroux:masterfrom
ruiwen:fix_query_interpolation

Conversation

@ruiwen

@ruiwen ruiwen commented Jan 12, 2013

Copy link
Copy Markdown

Thinking that interpolation might be more neatly done via str.replace() instead of string splitting along '?' characters. This patch allows for multiple interpolations as well, eg.

this.where("user.name === ? || user.age > ?", "john", 3, function(data) { 
    /* do stuff */ 
})

This patch also ensures that the callback is called at the end of the query

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

Successfully merging this pull request may close these issues.

1 participant