Closed jetpad closed 12 years ago
You must put the user object into store to save it.
store = NanoStore.shared_store
user = stub_user("Bob", 10, Time.now)
store << user
store.save
I've added a test case to demo that:
https://github.com/siuying/NanoStoreInMotion/blob/master/spec/store_extension_spec.rb#L115-123
Ah, great! Thanks for your work on this. It is really perfect for working with RubyMotion.
I may not quite understand how saving works. It seems that the only way to get objects saved to the database is to save each one using the save method on the object instead of delaying the save and calling the save method on the store. Replacing "user.save" in this code with "NanoStore.shared_store.save" breaks this case.