Giter Site home page Giter Site logo

Comments (7)

renchap avatar renchap commented on August 14, 2024 3

This is the culprit, replacing JSON with ActiveRecord::Coders::JSON fixes the issue. I will submit a PR to Rails.

from representable.

renchap avatar renchap commented on August 14, 2024 2

It has been merged into the 5-2-stable branch. You can switch rails to this branch in your Gemfile to get the fix, or wait for the next Rails 5.2 version to be released.

from representable.

apotonick avatar apotonick commented on August 14, 2024

Looks like Rails is grabbing the wrong constant - not in Representable's hand. Maybe dig into the yaml_column code?

from representable.

unrooty avatar unrooty commented on August 14, 2024

This is the code of yaml_column.rb 'load' method:

def load(yaml)
return object_class.new if object_class != Object && yaml.nil?
return yaml unless yaml.is_a?(String) && /^---/.match?(yaml)
obj = YAML.load(yaml)
assert_valid_value(obj, action: "load")
obj ||= object_class.new if object_class != Object
obj
end

I think it tries to create an instance of module and throws exception while this process. But I don't understand why it tries to create instance of JSON module in yaml_column.

from representable.

apotonick avatar apotonick commented on August 14, 2024

Yepp, must be somewhere further up the stack. Is Rails maybe looking for constants that equal JSON or something nasty like that? 🤔

from representable.

renchap avatar renchap commented on August 14, 2024

Could it be here: https://github.com/rails/rails/blob/master/activestorage/app/models/active_storage/blob.rb#L22 ? This is the first use of JSON when going up the stack.

from representable.

unrooty avatar unrooty commented on August 14, 2024

@renchap thank for work. Waitng for megre.

from representable.

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.