can't update json property

33 views
Skip to first unread message

Charles Monteiro

unread,
Jul 25, 2013, 4:05:39 PM7/25/13
to datam...@googlegroups.com
hi, 

I have a model property of type Json, said property is set to a hash of a hash, apparently updates the to the inner hash are not being picked up by DM. In a related question if I wanted to persist a hash, I guess type Object would be the default? are there any limits to the the level of nesting of an object ?

thanks

-Charles

Roman Dzvinkovsky

unread,
Mar 20, 2014, 3:00:49 AM3/20/14
to datam...@googlegroups.com
Charles,

I've faced similar problem recently. AFAIR the reason is that DataMapper does not recognize the change of hash under Json property. After several attempts I came up with workaround:

o.data[:key1][:key2] += 1
# o.save # doesn't work
data = o.data
o.data = nil
o.save
o.data = data
o.save




-Charles

--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+...@googlegroups.com.
To post to this group, send email to datam...@googlegroups.com.
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages