Why does destroying a transaction not remove the record from the loaded set?

10 views
Skip to first unread message

ch...@hiplogiq.com

unread,
Sep 9, 2014, 11:36:29 AM9/9/14
to batm...@googlegroups.com
I'm new to Batman and trying to learn on the run. When I create a transaction of a specific record and then destroy the transaction, the original record isn't removed from the loaded set. I'm doing validation based off of what is in the loaded set, so how can I refresh or update the loaded set when I destroy a transaction? Sorry for the newb question, please point me in any direction of some documentation or helpful resources. Much appreciated.

Robert Mosolgo

unread,
Sep 9, 2014, 11:45:43 AM9/9/14
to batm...@googlegroups.com
Great question! 

It's fixed in master:  https://github.com/batmanjs/batman/pull/1121

To reload all records from storage, you can use `Model.load`, then replace the loaded set with the results of that operation: https://www.softcover.io/read/b5c051f3/batmanjs_mvc_cookbook/model#sec-reload_all_records

(Note that the example there uses Batman 0.16 syntax for creating a set, not the syntax that's in master, more info: https://groups.google.com/forum/#!topic/batmanjs/KItI8Myffik)


robert

On Tue, Sep 9, 2014 at 8:36 AM, <ch...@hiplogiq.com> wrote:
I'm new to Batman and trying to learn on the run. When I create a transaction of a specific record and then destroy the transaction, the original record isn't removed from the loaded set. I'm doing validation based off of what is in the loaded set, so how can I refresh or update the loaded set when I destroy a transaction? Sorry for the newb question, please point me in any direction of some documentation or helpful resources. Much appreciated.

--
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.

ch...@hiplogiq.com

unread,
Sep 9, 2014, 5:41:40 PM9/9/14
to batm...@googlegroups.com, rdmo...@gmail.com
Wow, thank you! This was everything I was looking for and more!
Reply all
Reply to author
Forward
0 new messages