Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backbone.Model::pick isn't schema aware #25

Open
forivall opened this issue May 5, 2014 · 0 comments
Open

Backbone.Model::pick isn't schema aware #25

forivall opened this issue May 5, 2014 · 0 comments

Comments

@forivall
Copy link
Contributor

forivall commented May 5, 2014

This is a minor issue and I will fix it.

Backbone = require 'backbone'

class A extends Backbone.Model
  urlRoot: '/api/as'
  schema:
    b: -> ['belongsTo', B, manual_fetch: true]
  sync: require('backbone-http').sync(A)

class B extends Backbone.Model
  urlRoot: '/api/bs'
  schema:
    a: -> ['hasOne', A, manual_fetch: true]
  sync: require('backbone-http').sync(B)

a = new A({b: {id: 1}})
a.get('b_id') # => 1
a.pick('b_id') # => {}   SHOULD BE {b_id: 1}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant