Comments (12)
Well, same issue.
Had to fork v1.2.2 and cherry pick the 3 commits from #50.
Now, I just have to add this to my Gemfile
:
gem 'dm-types',
:git => 'git://github.com/julienma/dm-types.git',
:branch => 'gem-v1.2.2-with-frozen-nilclass-fix'
from dm-types.
Subsequent calls to exactly the same method work. Always fails the first time.
from dm-types.
This may be a dm-core issue, and only happens to manifest through dm-types because of the DirtyMinder module misdirection.
from dm-types.
This appears to be related to #71. Closing.
from dm-types.
Loading a collection at all, for the first time (as empty?
evidently does in dm) where one of the properties is Json
, Hash
, or Array
(the classes extended by hooks for dirtiness tracking) leads to this error. No other collection loading fails in this way. Pretty sure that makes it a dm-types issue.
from dm-types.
This is fixed by PR #50. But, despite it saying in the release from github that v1.2.2 v1.2.2...master has that PR included, looking at the code for the gem release 1.2.2 it does not have the code from PR #50.
from dm-types.
This issue has made me regret use datamapper at all :/
from dm-types.
same here. that's bad.
from dm-types.
kinda looks like this still isn't fixed, is this ever going to be fixed?
2016-06-30T14:17:40.172+0000 ERROR pwnscan#9456: Generic Error: can't
modify frozen NilClass
["/var/lib/gems/2.3.0/gems/dm-types-1.2.2/lib/dm-types/support/dirty_minder.rb:144:in
`track'",
"/var/lib/gems/2.3.0/gems/dm-types-1.2.2/lib/dm-types/support/dirty_minder.rb:161:in
`hook_value'",
"/var/lib/gems/2.3.0/gems/dm-types-1.2.2/lib/dm-types/support/dirty_minder.rb:151:in
`set!'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/resource.rb:880:in
`block in eager_load'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/resource.rb:880:in
`each'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/resource.rb:880:in
`eager_load'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/resource.rb:865:in
`lazy_load'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/property.rb:664:in
`lazy_load'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/resource/persistence_state/persisted.rb:23:in
`lazy_load'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/resource/persistence_state/persisted.rb:8:in
`get'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/model/property.rb:209:in
`attributes_meta'",
"/opt/pwnix/pwnscan/lib/pwnscan/helpers/host_update_helper.rb:21:in
`initialize'",
"/opt/pwnix/pwnscan/lib/pwnscan/models/network_host.rb:252:in `new'",
"/opt/pwnix/pwnscan/lib/pwnscan/models/network_host.rb:252:in
`update_from_parsed_hash'",
"/opt/pwnix/pwnscan/lib/pwnscan/models/network_host.rb:265:in
`mark_offline'",
"/opt/pwnix/pwnscan/lib/pwnscan/models/network_host.rb:97:in `block in
deduplicate'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/collection.rb:508:in
`block in each'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/support/lazy_array.rb:411:in
`block in each'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/support/lazy_array.rb:411:in
`each'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/support/lazy_array.rb:411:in
`each'",
"/var/lib/gems/2.3.0/gems/dm-core-1.2.1/lib/dm-core/collection.rb:505:in
from dm-types.
DM is mostly unmaintained. So, no, probably not getting fixed.
from dm-types.
Ran into this as well, accelerated a project's move off datamapper.
from dm-types.
This can be avoided by turning off lazy loading for the property.
property :some_json, Json, lazy: false
Obviously, you lose the benefits of lazy loading.
from dm-types.
Related Issues (20)
- DataMapper Incomatibilities with rails 3.1 HOT 1
- bcrypt-ruby update HOT 4
- IPAddress Property does not typecast Resolv::IPv4 / Resolv::IPv6 objects HOT 3
- Please update JSON dependency to 1.6.x HOT 7
- dm-types redefines the global CSV constant on Ruby 1.8 HOT 3
- ParanoidBoolean causes issues with belongs_to Relationships HOT 1
- DataMapper::Property::IPAddress attempts to typecase LIKE-queries HOT 5
- UUID: got error on jruby HOT 2
- uninitialized constant ClassName::Enum HOT 3
- Enums are nil when an already created object is fetched HOT 6
- multi-json dependency HOT 1
- Bump stringex dependency to ~>2.0.2 HOT 5
- [release 1.2] rspec failing HOT 1
- Upgrade to safe_yaml
- Exception when assigning an arbitrary string to a Json field
- brcypt-ruby name change HOT 6
- Missing code in release v1.2.2 HOT 3
- UUID missing from migration type map HOT 1
- Update json dependency HOT 1
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 dm-types.