Closed dkrusenstrahle closed 11 years ago
Have you set the store save_interval to some other values? Also, you might get more information by NanoStore.debug = true, that will print more information and give you more insights what is being done.
If that didnt help, please try to clone the NanoStoreInMotion project and add a test case to demonstrate the issue. If it is not possible, try to create a minimal app that reproduce the issue.
What do you mean by "Have you set the store save_interval to some other values"? Debug prints a lot of information.
You'll need to set a default store (or per model store) before save anything. A store can have a save_interval setting that cause the store to do batch saving. (check README and the spec to see the usage)
Yes it prints a lot of information. Thats why a minimal test case / example that reproduce the issue is important.
I added this to the appdelegate. Nothing more. It works to create, delete and find data from the DB but when I want to update a record it does not store it permanently. Strange thing is that it works to update in REPL.
NanoStore.shared_store = NanoStore.store(:file, App.documents_path + "/nano.db")
With the information provided I cannot tell where's the problem. Can you show a repeatable test case or minimal sample app?
Close due to lack of feedback.
Hello,
When I save record and then tries to update it I get no errors but it is not persisted.
tasks = Task.find(:id, NSFEqualTo, task).first tasks.track_time = "end" tasks.save
If I check p.track_time I get the correct value. But if I for example does this in Repl or other place in the app I get the original value and not the changed value.
tasks = Task.find(:id, NSFEqualTo, task).first tasks.track_time => start