Converts hash to/from JSON
ruby
- def convert_type
JSON
end
ruby
- def db_type
String
end
ruby
- def to_db(value)
value.to_json
end
ruby
- def to_ruby(value)
JSON.parse(value, quirks_mode: true)
end
Converts hash to/from JSON
ruby
- def convert_type
JSON
end
ruby
- def db_type
String
end
ruby
- def to_db(value)
value.to_json
end
ruby
- def to_ruby(value)
JSON.parse(value, quirks_mode: true)
end