backbone_extensions 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,10 +70,10 @@
70
70
  if (options.parse) {
71
71
  var associations = {
72
72
  hasMany: function(assocResponse, association, newOptions) {
73
- association.add(_(assocResponse).map(function(response) { return association.parse(response); }), newOptions);
73
+ association.add(_(assocResponse).compact(), newOptions);
74
74
  },
75
75
  hasOne: function(assocResponse, association, newOptions) {
76
- association.clear({silent: true}).set(association.parse(assocResponse), newOptions);
76
+ association.clear({silent: true}).set(assocResponse, newOptions);
77
77
  }
78
78
  };
79
79
 
@@ -107,8 +107,9 @@
107
107
 
108
108
  this._parsers.push({
109
109
  parseFn: parseFunc,
110
- associationFn: function(assocResponse) {
111
- associations[associationType].call(this, assocResponse, this[associationName](), mergeAssociationOptions(options, this._options));
110
+ associationFn: function(response) {
111
+ var association = this[associationName]();
112
+ return associations[associationType].call(this, association.parse(response), association, mergeAssociationOptions(options, this._options));
112
113
  }
113
114
  });
114
115
  }
@@ -1,3 +1,3 @@
1
1
  module BackboneExtensions
2
- VERSION = '0.0.12'
2
+ VERSION = '0.0.13'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backbone_extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -126,7 +126,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
126
126
  version: '0'
127
127
  segments:
128
128
  - 0
129
- hash: -2290577427496042019
129
+ hash: 1033708220958971973
130
130
  required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  none: false
132
132
  requirements:
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  version: '0'
136
136
  segments:
137
137
  - 0
138
- hash: -2290577427496042019
138
+ hash: 1033708220958971973
139
139
  requirements: []
140
140
  rubyforge_project:
141
141
  rubygems_version: 1.8.24