Skip to content

Instantly share code, notes, and snippets.

@zimt28
zimt28 / entries.js
Created Apr 30, 2014
Meteor app - Allow rules
View entries.js
Meteor.Collection.prototype.addTimestamps = function () {
this.deny({
insert: function(userId, doc) {
doc.createdAt = Date.now();
doc.updatedAt = Date.now();
return false;
},
update: function(userId, doc, fieldNames, modifier) {
modifier.$set.updatedAt = Date.now();
You can’t perform that action at this time.