mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-01 19:37:29 -05:00
15 lines
322 B
JavaScript
15 lines
322 B
JavaScript
const Model = Ember.Object.extend();
|
|
|
|
Model.reopenClass({
|
|
extractByKey: function(collection, klass) {
|
|
var retval = {};
|
|
if (Ember.isEmpty(collection)) { return retval; }
|
|
|
|
collection.forEach(function(item) {
|
|
retval[item.id] = klass.create(item);
|
|
});
|
|
return retval;
|
|
}
|
|
});
|
|
|
|
export default Model;
|