wrap unorthodox sync calls to run through parse #72

Merged
merged 3 commits into from Apr 11, 2013

Conversation

Projects
None yet
2 participants
Contributor

jessehouchins commented Apr 8, 2013

No description provided.

src/modelbase.js
+ callbackWithParse: function(callback) {
+ return function(err, data) {
+ var args = _.toArray(arguments)
+ args[1] = this.parse(args[1] || {})
@jessehouchins

jessehouchins Apr 8, 2013

Contributor

should data ever be allowed to be undefined or null?

@mikefrey

mikefrey Apr 11, 2013

Contributor

Good point. Maybe we should change this to args[1] = this.parse(args[1] || null)

+ callbackWithParse: function(callback) {
+ return function(err, data) {
+ var args = _.toArray(arguments)
+ if (args[1]) args[1] = this.parse(args[1])
@mikefrey

mikefrey Apr 11, 2013

Contributor

👍

Contributor

mikefrey commented Apr 11, 2013

Looks good to me. Merging and will publish shortly.

mikefrey added a commit that referenced this pull request Apr 11, 2013

Merge pull request #72 from sportngin/sync-fix
wrap unorthodox sync calls to run through parse

@mikefrey mikefrey merged commit 9d2c6b0 into master Apr 11, 2013

@mikefrey mikefrey deleted the sync-fix branch Apr 11, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment