I have a hash that contains only string keys and simple datatypes that are compatible with JSON (numeric values, arrays, string, and objects containing the same).
I'd like to know what ActiveRecord (or any other layers involved) does to translate that ruby hash into the SQL statement that stores it in a JSONB column.
Using rails 4.2.7.1
, and pg 0.20.0
Does ActiveRecord just call #to_json
on the hash, and the resulting String
is put in the SQL query, and that's it?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.