Merge pull request #1477 from velesin/remove_builders_from_merge_attributes

removes unused builders param from Discourse.Model.mergeAttributes
This commit is contained in:
Robin Ward 2013-09-30 10:07:50 -07:00
commit ca0c41fd40
1 changed files with 2 additions and 15 deletions

View File

@ -14,24 +14,11 @@ Discourse.Model = Ember.Object.extend(Discourse.Presence, {
@method mergeAttributes
@param {Object} attrs The attributes we want to merge with
@param {Object} builders Optional builders to use when merging attributes
**/
mergeAttributes: function(attrs, builders) {
mergeAttributes: function(attrs) {
var _this = this;
_.each(attrs, function(v,k) {
// If they're in a builder we use that
var builder, col;
if (typeof v === 'object' && builders && (builder = builders[k])) {
if (!_this.get(k)) {
_this.set(k, Em.A());
}
col = _this.get(k);
_.each(v,function(obj) {
col.pushObject(builder.create(obj));
});
} else {
_this.set(k, v);
}
_this.set(k, v);
});
}