You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The log doesn't respect complex data types such as jsonb, array, hstore, etc (due to the usage of hstore under the hood. The values for these types are just strings.
We have to manually cast them back to appropriate Ruby structure.
Example:
post=Post.create!(tags: ['some','tag'])# tags is an array columnpost.udpate!(tags: ['other'])post.reload.diff_from(...)#=> {"old"=>{"tags"=>["some", "tag"]}, "new"=>"{\"tags\": [\"other\"]}"}# but should be#=> {"old"=>{"tags"=>["some", "tag"]}, "new"=>{"tags"=>["other"]}}
The problem also may affect the at methods.
The text was updated successfully, but these errors were encountered:
Related to #30
The problem
The log doesn't respect complex data types such as
jsonb
,array
,hstore
, etc (due to the usage ofhstore
under the hood. The values for these types are just strings.We have to manually cast them back to appropriate Ruby structure.
Example:
The problem also may affect the
at
methods.The text was updated successfully, but these errors were encountered: