I hereby claim:
- I am seyz on github.
- I am seyz (https://keybase.io/seyz) on keybase.
- I have a public key whose fingerprint is EA75 28E4 41FB 9F6E 7EBD F1E7 743A 6D64 F9C4 6230
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
'use strict'; | |
import Ember from 'ember'; | |
import SmartViewMixin from 'client/mixins/smart-view-mixin'; | |
export default Ember.Component.extend(SmartViewMixin.default, { | |
initConversations: function () { | |
this.send('switchConversation', this.get('records.firstObject')); | |
}.on('didInsertElement').observes('records.[]'), | |
actions: { | |
switchConversation: function (conversation) { |
// models/addresses.js | |
module.exports = (sequelize, DataTypes) => { | |
let Address = sequelize.define('addresses', { | |
// ... | |
}, { | |
// ... | |
}); | |
Address.associate = (models) => { | |
Address.belongsTo(models.customers); |
/* models/customers.js */ | |
module.exports = (sequelize, DataTypes) => { | |
var Customer = sequelize.define('customers', { | |
// ... | |
}, { | |
// ... | |
}); | |
Customer.associate = (models) => { | |
Customer.hasOne(models.addresses); |
/* models/customers.js */ | |
module.exports = (sequelize, DataTypes) => { | |
var Customer = sequelize.define('customers', { | |
// ... | |
}, { | |
// ... | |
}); | |
Customer.associate = (models) => { | |
Customer.hasMany(models.orders); |
SELECT COUNT(*) AS value | |
FROM customers; |
SELECT current.count AS value, previous.count AS previous | |
FROM ( | |
SELECT COUNT(*) | |
FROM appointments | |
WHERE start_date BETWEEN '2018-01-01' AND '2018-02-01' | |
) as current, ( | |
SELECT COUNT(*) | |
FROM appointments | |
WHERE start_date BETWEEN '2017-12-01' AND '2018-01-01' | |
) as previous; |
SELECT transactions.status AS key, COUNT(*) AS value | |
FROM transactions | |
GROUP BY status; |
SELECT DATE_TRUNC('month', start_date) AS key, COUNT(*) as value | |
FROM appointments | |
GROUP BY key | |
ORDER BY key; |
SELECT DATE_TRUNC('month', transactions.created_at) AS key, SUM(transactions.amount) / 100 AS value | |
FROM companies | |
JOIN transactions ON companies.id = transactions.beneficiary_company_id | |
WHERE companies.id = ? | |
GROUP BY key; |