Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for JSONB #79

Open
g00ds0n opened this issue Jul 11, 2019 · 8 comments
Open

Support for JSONB #79

g00ds0n opened this issue Jul 11, 2019 · 8 comments

Comments

@g00ds0n
Copy link

g00ds0n commented Jul 11, 2019

I don't see any of my JSONB columns being stored in the revisions. Am I doing something wrong or does paper trail not support JSONB for Postgres?

@jdgarvey
Copy link

I am running into this as well, I am guessing that paper trail does not support JSON or JSONB?

@nielsgl
Copy link
Owner

nielsgl commented Aug 16, 2019

AFAIK it doesn't support it but I'm happy to merge a pull request for this.

@nielsgl
Copy link
Owner

nielsgl commented Aug 18, 2019

@g00ds0n @jdgarvey JSONB should be supported with the latest version 3.0.0-rc.11. Let me know whether it does or does not work :)

@g00ds0n
Copy link
Author

g00ds0n commented Sep 23, 2019

Nope I still don't see my JSONB objects inside of document. If you tell me where to start I can try and make a PR for you to look at.

@g00ds0n
Copy link
Author

g00ds0n commented Sep 26, 2019

@nielsgl As far as I can tell this is omitting JSONB columns because they are objects. I'm not exactly sure how to fix this.

currentVersion = _.omitBy(
currentVersion,
i =>
i != null &&
typeof i === 'object' &&
!(i instanceof Date),
);

@g00ds0n
Copy link
Author

g00ds0n commented Sep 26, 2019

I don't fully understand what that omitBy statement does, but I think using rawAttributes might fix this:

currentVersion = _.pick(currentVersion, Object.keys(instance.rawAttributes));

@g00ds0n
Copy link
Author

g00ds0n commented Sep 26, 2019

Check PR #85.

@yujiosaka
Copy link

fixed it in my fork
yujiosaka@d22cd54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants