Giter Site home page Giter Site logo

Comments (9)

shioyama avatar shioyama commented on May 18, 2024 1

The fix for this issue has been released in version 0.2.2.

from mobility.

shioyama avatar shioyama commented on May 18, 2024

Does this happen if you use Mobility version 0.1.20 ?

from mobility.

jnylen avatar jnylen commented on May 18, 2024

Nope, it returns the same for 0.1.20.

from mobility.

shioyama avatar shioyama commented on May 18, 2024

I can reproduce this. It seems to be a problem with the jsonb columns not having a default value. In AR this is handled by setting default: '' (in Rails 4 it was default: '{}'), which in the tests happens here. In the case of Sequel this doesn't seem to be happening and I can't find much documentation on it.

Without a default value, this will happen when dirty tries to check the previous value of a new column.

from mobility.

shioyama avatar shioyama commented on May 18, 2024

Hmm... maybe this: jeremyevans/sequel#1330

I'll have to look into this a bit.

from mobility.

shioyama avatar shioyama commented on May 18, 2024

Ok, I confirmed I can fix this with:

plugin :defaults_setter
attributes.each { |attribute| self.default_values[attribute.to_sym] = lambda { ::Sequel.pg_jsonb({}) } }

in the setup block for the jsonb backend. I suppose hstore may need it as well.

from mobility.

shioyama avatar shioyama commented on May 18, 2024

Try the sequel_jsonb_dirty branch, here: https://github.com/shioyama/mobility/tree/sequel_jsonb_dirty

from mobility.

jnylen avatar jnylen commented on May 18, 2024

@shioyama Seems to work.

Thanks again for this gem! :)

from mobility.

shioyama avatar shioyama commented on May 18, 2024

Great, I'll just have a closer look and merge that change in the next couple days. For now pls just use that branch.

from mobility.

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.