Skip to content

Commit a33287d

Browse files
Update Active Record Store docs to mention SQLite JSON usage
In addition to PosgreSQL JSON and MySQL JSON data types, developers need to use `store_accessor` instead of `store` when working with SQLite's JSON data type as well.
1 parent b26a9fd commit a33287d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

activerecord/lib/active_record/store.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ module ActiveRecord
2525
# You can set custom coder to encode/decode your serialized attributes to/from different formats.
2626
# JSON, YAML, Marshal are supported out of the box. Generally it can be any wrapper that provides +load+ and +dump+.
2727
#
28-
# NOTE: If you are using structured database data types (e.g. PostgreSQL +hstore+/+json+, or MySQL 5.7+
29-
# +json+) there is no need for the serialization provided by {.store}[rdoc-ref:rdoc-ref:ClassMethods#store].
28+
# NOTE: If you are using structured database data types (e.g. PostgreSQL +hstore+/+json+, MySQL 5.7+
29+
# +json+, or SQLite 3.38+ +json+) there is no need for the serialization provided by {.store}[rdoc-ref:rdoc-ref:ClassMethods#store].
3030
# Simply use {.store_accessor}[rdoc-ref:ClassMethods#store_accessor] instead to generate
3131
# the accessor methods. Be aware that these columns use a string keyed hash and do not allow access
3232
# using a symbol.

0 commit comments

Comments
 (0)