Skip to content

Commit

Permalink
Merge pull request #484 from mattbeedle/jsonb
Browse files Browse the repository at this point in the history
Add support for PostgreSQL jsonb columns
  • Loading branch information
batter committed Feb 12, 2015
2 parents d86eb79 + a7ef176 commit e547bc8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/paper_trail/version_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ def primary_key_is_int?

# 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

Expand Down

0 comments on commit e547bc8

Please sign in to comment.