| 7 | var Person = null; |
| 8 | |
| 9 | var setup = function (nameDefinition, opts) { |
| 10 | opts = opts || {}; |
| 11 | |
| 12 | return function (done) { |
| 13 | Person = db.define("person", { |
| 14 | name : nameDefinition || String |
| 15 | }, opts || {}); |
| 16 | |
| 17 | Person.hasOne("parent", Person, opts.hasOneOpts); |
| 18 | if ('saveAssociationsByDefault' in opts) { |
| 19 | Person.settings.set( |
| 20 | 'instance.saveAssociationsByDefault', opts.saveAssociationsByDefault |
| 21 | ); |
| 22 | } |
| 23 | |
| 24 | return helper.dropSync(Person, done); |
| 25 | }; |
| 26 | }; |
| 27 | |
| 28 | before(function (done) { |
| 29 | helper.connect(function (connection) { |