Comments (7)
This is the culprit, replacing JSON
with ActiveRecord::Coders::JSON
fixes the issue. I will submit a PR to Rails.
from representable.
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.
Looks like Rails is grabbing the wrong constant - not in Representable's hand. Maybe dig into the yaml_column
code?
from representable.
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.
Yepp, must be somewhere further up the stack. Is Rails maybe looking for constants that equal JSON
or something nasty like that? 🤔
from representable.
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.
@renchap thank for work. Waitng for megre.
from representable.
Related Issues (20)
- Using the :skip_parse option with JSON::Hash values produces Pipeline::Stop HOT 1
- XML Encoding? HOT 3
- Populator docs or examples? HOT 4
- XML namespaces
- Options hash passed to setter has incorrect value for collection properties
- Collection parsing raises an error if the value is nil HOT 4
- Document nested inherit: true
- Parsing null values results in property being set despite `reader` property present
- parsing array of arrays
- Bug in dependency package declarative-option update HOT 1
- Nested keys within hash are getting mutated HOT 5
- Custom writer: method is not invoked or not invoked correctly HOT 2
- Can't activate multi_json on (>= 1.14.1), already activated multi_json-1.11.3 HOT 3
- Representable doesn't work as expected on truffleruby-21.3.0 HOT 1
- Nokogiri deprecation warning
- `nested` tries to assign to non-existent property when parsing nil body HOT 7
- Combining nested include/exclude with regular include/exclude HOT 1
- Representing objects into objects using Representable::Object#to_object HOT 8
- Representable 4: problem when parsing looks at one field but wants to create two
- Representable 4: how to collect/write data when parsing?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from representable.