Created
March 12, 2013 04:19
-
-
Save davelester/5140329 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/models/badge.js b/models/badge.js | |
index 01c2eeb..8b9e4ff 100644 | |
--- a/models/badge.js | |
+++ b/models/badge.js | |
@@ -21,6 +21,10 @@ Badge.prototype.presave = function () { | |
} | |
}; | |
+Badge.prototype.postsave = function() { | |
+ | |
+}; | |
+ | |
Badge.confirmRecipient = function confirmRecipient(assertion, email) { | |
// can't validate if not given an assertion | |
if (!assertion) | |
diff --git a/models/mysql-base.js b/models/mysql-base.js | |
index 7108715..de132e7 100644 | |
--- a/models/mysql-base.js | |
+++ b/models/mysql-base.js | |
@@ -102,6 +102,9 @@ Base.prototype.save = function save(callback) { | |
this.presave(); | |
client._upsert(table, attributes, parseResult.bind(this)); | |
+ | |
+ if ('function' === typeof this.presave) | |
+ this.postsave(); | |
}; | |
Base.prototype.destroy = function (callback) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment