palkan / logidze

Database changes log for Rails
MIT License
1.59k stars 74 forks source link

fix: support JSON columns #210

Closed baygeldin closed 2 years ago

baygeldin commented 2 years ago

What is the purpose of this pull request?

Fixes #209.

What changes did you make? (overview)

I don't think it's a good idea to create a custom comparison operator for a built-in type (also it wouldn't work in this case anyway), so I think casting pseudorecords to JSONB before comparing them is a better workaround.

Is there anything you'd like reviewers to focus on?

Honestly, a better solution would be to use JSONB over JSON in most cases. So chances of running into this issue are pretty low, but a bug is a bug.

Checklist

fameoflight commented 2 years ago

I know it's asking too much, but how would I implement if I just want to track if the json was updated or not, not the actual content. Or only one of the keys in jsonb