[guadec-web-regcfp/develop] papervote



commit 87087f1fc8d516cd1a60de225d8fc92c283ef235
Author: Patrick Uiterwijk <puiterwijk redhat com>
Date:   Thu May 21 13:55:17 2015 +0200

    papervote

 models/paper.js     |    1 +
 models/papervote.js |   18 ++++++++++++++++++
 routes/auth.js      |    1 -
 3 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/models/paper.js b/models/paper.js
index dfac904..3efd185 100644
--- a/models/paper.js
+++ b/models/paper.js
@@ -9,6 +9,7 @@ module.exports = function(sequelize, DataTypes) {
     classMethods: {
       associate: function(models) {
         Paper.belongsTo(models.User);
+        Paper.hasMany(models.PaperVote);
       }
     }
   });
diff --git a/models/papervote.js b/models/papervote.js
new file mode 100644
index 0000000..c88d889
--- /dev/null
+++ b/models/papervote.js
@@ -0,0 +1,18 @@
+"use strict";
+
+module.exports = function(sequelize, DataTypes) {
+  var PaperVote = sequelize.define("PaperVote", {
+    comment: DataTypes.STRING,
+    vote: DataTypes.INTEGER,
+    abstained: DataTypes.BOOLEAN
+  }, {
+    classMethods: {
+      associate: function(models) {
+        PaperVote.belongsTo(models.User);
+        PaperVote.belongsTo(models.Paper);
+      }
+    }
+  });
+
+  return PaperVote;
+};
diff --git a/routes/auth.js b/routes/auth.js
index 39ec264..b575b3b 100644
--- a/routes/auth.js
+++ b/routes/auth.js
@@ -31,7 +31,6 @@ router.post('/login', function(req, res, next) {
 
   browserid(assertion, persona_audience,
     function(err, email, response) {
-      console.log('Testing');
       if(err) {
         console.log('Invalid BrowserID assertion: ' + err);
         res.status(500).send('Invalid assertion!');


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]