Save {only: [keys...]} not working

9 views
Skip to first unread message

Zachary Dixon

unread,
Jun 11, 2014, 10:33:37 PM6/11/14
to batm...@googlegroups.com
I'm trying to save a record but only send over certain attributes, which it looks like the only: option is suppose to do this.

sub.save {only: ['subscribed']}, (err, record) ->

In the request, every attribute is still being sent over.

(I've tried searching to see if this has been reported/fixed but not luck, so I apologize if there's already info on this out there)

Robert Mosolgo

unread,
Jun 11, 2014, 11:49:45 PM6/11/14
to batm...@googlegroups.com
Yes, your example looks right (here's the PR where it was added, for reference: https://github.com/batmanjs/batman/pull/951). Are you on the latest version (0.16) of batman.js?


--
You received this message because you are subscribed to the Google Groups "batman.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to batmanjs+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zachary Dixon

unread,
Jun 12, 2014, 4:14:21 PM6/12/14
to batm...@googlegroups.com, rdmo...@gmail.com
Awesome, updated my batman-rails gem and everything works now, thanks!

Zachary Dixon

unread,
Jun 17, 2014, 4:57:11 PM6/17/14
to batm...@googlegroups.com, rdmo...@gmail.com
I'm having an issue with `only:` overriding the entire model in LocalStorage as mentioned in the PR. Do you know if this is compatible with the LocalStorage adapter? Not a big deal since I can just call save() locally as there's no performance gain in localstorage, just wondering.
Reply all
Reply to author
Forward
0 new messages