Merge pull request #484 from mattbeedle/jsonb
Add support for PostgreSQL jsonb columns
This commit is contained in:
commit
e547bc8bdb
|
@ -116,12 +116,12 @@ module PaperTrail
|
|||
|
||||
# Returns whether the `object` column is using the `json` type supported by PostgreSQL
|
||||
def object_col_is_json?
|
||||
@object_col_is_json ||= columns_hash['object'].type == :json
|
||||
@object_col_is_json ||= [:json, :jsonb].include?(columns_hash['object'].type)
|
||||
end
|
||||
|
||||
# Returns whether the `object_changes` column is using the `json` type supported by PostgreSQL
|
||||
def object_changes_col_is_json?
|
||||
@object_changes_col_is_json ||= columns_hash['object_changes'].try(:type) == :json
|
||||
@object_changes_col_is_json ||= [:json, :jsonb].include?(columns_hash['object_changes'].try(:type))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue