tgriesser/bookshelf — pull request #300 by wjmao88 (2014-03-25 05:27:57+00:00)
Title: fetchOne resets query on original object

Before this change, a fetchOne call does not reset the query on the original object like a fetch call does. Thus consecutive fetchOne's will result in queries after the first using the conditions from the sum of previous queries.
i.e.
Animals.query({name: 'cat'}).fetchOne() // queries for where name = "cat"
//some time later
Animals.query({name: 'dog'}).fetchOne() // queries for where name = "cat" and name = "dog"

calling resetQuery after copying the query to model solves the problem.