Merge pull request #484 from mattbeedle/jsonb

Add support for PostgreSQL jsonb columns
This commit is contained in:
Ben Atkins 2015-02-12 17:53:42 -05:00
commit e547bc8bdb
1 changed files with 2 additions and 2 deletions

View File

@ -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