by Ossi Hanhinen, @ohanhi
with the support of Futurice 💚.
Licensed under CC BY 4.0.
| # supervisor | |
| # | |
| # Author: Günter Grodotzki <[email protected]> | |
| # Version: 2015-04-25 | |
| # | |
| # - set param "SUPERVISE=enable" to activate | |
| # - chmod +x supervise.sh | |
| # | |
| packages: | |
| yum: |
| import mongooseResource from '../lib/mongoose-resource'; | |
| import Foo from '../models/foo'; // a mongoose Model | |
| export default mongooseResource('foo', Foo); |
This post is one in a series on converting a Backbone app to Ember. See also Ember-Data Notes.
Recently, our team has been trying to get Ember-Data to work with an API that does not conform to the json:api standard. The experience has been mostly good, but we've really struggled with the relationships. We have a Customer model that has many pastInvoices and a single monthToDateInvoice. The URL for past invoices is /billing/invoice?explicit_customer_id={{customerId}}; for month-to-date, it's /billing?no_list=true&explicit_customer_id={{customerId}}. The JSON that the API returns for a customer does not include any link to those URLs.
Our first attempt was to create an InvoiceAdapter that understood how to fetch invoices from those URLs:
// app/billing/invoices/adapter.js:| angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers']) | |
| .run(function(DB) { | |
| DB.init(); | |
| }); |
| <?php | |
| use Faker\Factory as Faker; | |
| abstract class ApiTester extends TestCase { | |
| /** | |
| * @var int | |
| */ | |
| protected $times = 1; |