You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running node v0.10.21, orm v2.1.3, orm-timestamps v0.2.0. I'm mostly following the example code:
app.use(orm.express(config.mysql,{define: function(db,models){db.use(modts);varuser=db.define('user',{username: String,email: String,password: String},{timestamp: true});user.sync(function(err){if(err){console.error("error creating user model: "+err);}});}}));
and I get the resulting exception:
ReferenceError: persist is not defined
at Object.monitor [as beforeDefine] (/Users/kevin/Documents/Projects/node/timestamp/node_modules/orm-timestamps/lib/orm-timestamps.js:48:6)
at ORM.define (/Users/kevin/Documents/Projects/node/timestamp/node_modules/orm/lib/ORM.js:213:20)
at Object.app.use.orm.express.define (/Users/kevin/Documents/Projects/node/timestamp/app.js:40:23)
at /Users/kevin/Documents/Projects/node/timestamp/node_modules/orm/lib/Express.js:38:9
at Handshake._callback (/Users/kevin/Documents/Projects/node/timestamp/node_modules/orm/lib/ORM.js:127:13)
at Handshake.Sequence.end (/Users/kevin/Documents/Projects/node/timestamp/node_modules/mysql/lib/protocol/sequences/Sequence.js:75:24)
at Handshake.Sequence.OkPacket (/Users/kevin/Documents/Projects/node/timestamp/node_modules/mysql/lib/protocol/sequences/Sequence.js:84:8)
at Protocol._parsePacket (/Users/kevin/Documents/Projects/node/timestamp/node_modules/mysql/lib/protocol/Protocol.js:172:24)
at Parser.write (/Users/kevin/Documents/Projects/node/timestamp/node_modules/mysql/lib/protocol/Parser.js:62:12)
at Protocol.write (/Users/kevin/Documents/Projects/node/timestamp/node_modules/mysql/lib/protocol/Protocol.js:37:16)
This is the line in orm-timestamps:
if(persist&&options.createdProperty!==false)
I don't see 'persist' defined in the module itself, so that may be the issue here. Just for testing purposes, I added "var persist = true" after "options" is extend and that resolved the issue for me.
Thanks,
Kevin
The text was updated successfully, but these errors were encountered:
Hi Kevin,
Thanks for the bug report - was caused by a quick edit I made to the code to add the option of not persisting timestamps to the database (for example, in a server environment where you wish to keep track of the last modification date for objects in memory).
I'm running node v0.10.21, orm v2.1.3, orm-timestamps v0.2.0. I'm mostly following the example code:
and I get the resulting exception:
This is the line in orm-timestamps:
I don't see 'persist' defined in the module itself, so that may be the issue here. Just for testing purposes, I added "var persist = true" after "options" is extend and that resolved the issue for me.
Thanks,
Kevin
The text was updated successfully, but these errors were encountered: