Coder Social home page Coder Social logo

Support for JSONB about sequelize-paper-trail HOT 8 OPEN

nielsgl avatar nielsgl commented on May 23, 2024
Support for JSONB

from sequelize-paper-trail.

Comments (8)

jdgarvey avatar jdgarvey commented on May 23, 2024

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

from sequelize-paper-trail.

nielsgl avatar nielsgl commented on May 23, 2024

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

from sequelize-paper-trail.

nielsgl avatar nielsgl commented on May 23, 2024

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

from sequelize-paper-trail.

g00ds0n avatar g00ds0n commented on May 23, 2024

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.

from sequelize-paper-trail.

g00ds0n avatar g00ds0n commented on May 23, 2024

@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),
);

from sequelize-paper-trail.

g00ds0n avatar g00ds0n commented on May 23, 2024

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));

from sequelize-paper-trail.

g00ds0n avatar g00ds0n commented on May 23, 2024

Check PR #85.

from sequelize-paper-trail.

yujiosaka avatar yujiosaka commented on May 23, 2024

fixed it in my fork
yujiosaka@d22cd54

from sequelize-paper-trail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.