(main)> App::Persistence[:test] = {a:1,b:2}
=> {:a=>1, :b=>2}
(main)> App::Persistence[:test][:c]=3
2012-07-11 20:04:43.777 my-app[11064:15203] can't modify frozen/immutable hash (RuntimeError)
=> #<RuntimeError: can't modify frozen/immutable hash>
(main)> exit
[rubymotion][~/Documents/web/my-app/rubymotion] rake
Build ./build/iPhoneSimulator-5.1-Development
...
(main)> App::Persistence[:test]
=> {"a"=>1, "b"=>2}
(main)> App::Persistence[:test][:c]=3
=> 3
(main)> App::Persistence[:test]
=> {"a"=>1, "b"=>2, "c"=>3}
(main)> exit
[rubymotion][~/Documents/web/my-app/rubymotion] rake
Build ./build/iPhoneSimulator-5.1-Development
...
(main)> App::Persistence[:test]
=> {"a"=>1, "b"=>2}
The middle case puzzled me for a bit as to why it wasn't returned in step 3, but I see now that the assignment of :c actually failed, but it appears as if it succeeded. I'm not sure if there is a way it could be more clear that this isn't possible (as in the first case).
Or... even better if there was a way to achieve this type of direct assignment of nested attributes. It would save some trouble from having to get the existing hash, set the nested attributes, and then persist.