This file contains hidden or 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
| var EmailReportCardToParent = function(obj) { | |
| this.obj = obj | |
| this.decorate() | |
| return obj | |
| }; | |
| EmailReportCardToParent.prototype = _.extend(EmailReportCardToParent.prototype, { | |
| // specify the method that you want to decorate | |
| methodToDecorate: 'saveReportCardAsPDF', |
This file contains hidden or 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
| var _ = require('underscore') | |
| var GenerateReportCard = function(student) { | |
| this.student = student | |
| }; | |
| GenerateReportCard.prototype = _.extend(GenerateReportCard.prototype, { | |
| run: function() { | |
| return _.compose( |
This file contains hidden or 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
| new GenerateReportCard(student).run() | |
| .then(function(student) { | |
| return new EmailReportCardToParent(student).run() | |
| }) |
This file contains hidden or 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
| submit_preliminary_questions |
This file contains hidden or 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
| var utensils = require('./lib/utensils'); | |
| var Query = utensils.Query; | |
| var db = require('./db'); | |
| var Q = require('q'); | |
| var ActiveAccountsQuery = Query.extend({ | |
| db: db, |
This file contains hidden or 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
| var utensils = require('./lib/utensils'); | |
| var Form = utensils.Form; | |
| var Validator = utensils.Validator; | |
| var Service = utensils.Service; | |
| var AccountValidator = Validator.extend({ | |
| email: function() { |
This file contains hidden or 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
| var Service = require('./service'); | |
| var CreateAccount = Service.extend({ | |
| procedure: [ | |
| 'persist', | |
| 'sendEmail', | |
| 'generateSomething' | |
| ], |
This file contains hidden or 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
| function extend(protoProps, staticProps) { | |
| var parent = this; | |
| var child; | |
| if (protoProps && _.has(protoProps, 'constructor')) { | |
| child = protoProps.constructor; | |
| } else { | |
| child = function(){ return parent.apply(this, arguments); }; | |
| } |
This file contains hidden or 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
| var _ = require('underscore') | |
| var expect = require('chai').expect; | |
| var Policy = require('./Policy'); | |
| describe('Policy', function(){ | |
| it('returns true if the object passes the policy tests', function(){ | |
| var student = { | |
| firstName: 'John', | |
| lastName: 'Smith', | |
| isExpelled: false, |
This file contains hidden or 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
| var _ = require('underscore'); | |
| var PassingStudentPolicy = require('./passingStudentPolicy'); | |
| var SportsEligibilityPolicy = function(student) { | |
| this.student = student; | |
| }; | |
| SportsEligibilityPolicy.prototype = _.extend(SportsEligibilityPolicy.prototype, { | |
| run: function() { |