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
| Kumo.AppsNewApplicationRoute = Ember.Route.extend({ | |
| setupController: function (controller) { | |
| // Doesn't work | |
| controller.set({ | |
| model: controller.get('controllers.appsNewIndex.model'), | |
| projects: controller.get('controllers.appsNewIndex.projects') | |
| }); | |
| // Works fine | |
| controller.set('model', controller.get('controllers.appsNewIndex.model')).set('projects', controller.get('controllers.appsNewIndex.projects')); |
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
| /** | |
| * Decorates the model with a new method that has access to original methods | |
| * @param model | |
| * @param name | |
| * @param method | |
| */ | |
| function decorateModel (model, name, method) { | |
| var originalMethod = model[name], | |
| decorator = function () { | |
| var returnVal; |
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 EmberWrapper = Intaglio.wrappers.abstract.extend({ | |
| init: function (object) { | |
| this._object = object; | |
| }, | |
| unknownProperty: function (key) { | |
| return this._object.get(key); | |
| }, |
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'); | |
| Kumo.AppsAppController = Ember.ObjectController.extend({ | |
| branches: null, | |
| _refreshContainer: null, | |
| _active: false, | |
| init: function () { | |
| var self = this; |
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
| Kumo.AppsNewController = Ember.ObjectController.extend(Ember.PromiseProxyMixin, { | |
| projects: null, | |
| selectedProject: null, | |
| repositories: null, | |
| repositoriesGetter: function () { | |
| var self = this; | |
| return ORM.factory('repository').where('projectId').isEqual(this.get('selectedProject.id')).findAll().then(function (data) { | |
| self.set('repositories', data); |
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 Kumo = require('./../../kumo'); | |
| Kumo.AppsNewRoute = Ember.Route.extend({ | |
| model: function () { | |
| var self = this; | |
| return Em.RSVP.hash({ | |
| projects: ORM.factory('project').orderBy('name').findAll(), | |
| application: ORM.factory('application').create() | |
| }); | |
| }, |
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 Intaglio = require('intaglio'), | |
| rest = require('../index'); | |
| var mysqlRepository = new Intaglio.repositories.mysql({ | |
| host: "192.168.33.10", | |
| user: "test", | |
| password: "", | |
| database: "test_employees" | |
| }), | |
| ORM = Intaglio.ORM; |
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
| { | |
| "_links": { | |
| "foo": { | |
| "create": { | |
| "href": "http://api.example.com/foo", | |
| "method": "POST" | |
| }, | |
| "find": { | |
| "href": "http://api.example.com/foo?{field]={value}" | |
| }, |
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
| // This is just some test stuff for right meow | |
| var ORM = require('./lib/orm'); | |
| var mysqlRepository = new ORM.repositories.mysql({ | |
| host: "192.168.33.10", | |
| user: "test", | |
| password: "", | |
| database: "test_orm" | |
| }); |
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
| // Single ORM instance usage | |
| ORM.create(mysqlRepository).then(function (orm) { | |
| /* App logic goes here */ | |
| orm.factory('foo'); | |
| }, err); | |
| // Multiple ORM instance usage | |
| var ORMs = { | |
| mysqlOrm: ORM.create(mysqlRepository), |