balderdashy/waterline — pull request #166 by ghernandez345 (2013-11-05 19:12:38+00:00)
Title: Fix for findOrCreate that preforms a find first before it creates a new record

findOrCreate was only creating a new record, and therefore would always call beforeCreate and afterCreate lifecycle callbacks. This performs a find first that returns the record if it is found, or creates a new record if nothing was found. I've also replaced the create logic with a call to the create method. This was written to address the bug discussed in #165.