Giter Site home page Giter Site logo

Comments (12)

julienma avatar julienma commented on June 24, 2024 5

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.

tpitale avatar tpitale commented on June 24, 2024

Subsequent calls to exactly the same method work. Always fails the first time.

from dm-types.

tpitale avatar tpitale commented on June 24, 2024

This may be a dm-core issue, and only happens to manifest through dm-types because of the DirtyMinder module misdirection.

from dm-types.

tpitale avatar tpitale commented on June 24, 2024

This appears to be related to #71. Closing.

from dm-types.

tpitale avatar tpitale commented on June 24, 2024

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.

tpitale avatar tpitale commented on June 24, 2024

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.

robclancy avatar robclancy commented on June 24, 2024

This issue has made me regret use datamapper at all :/

from dm-types.

gregory avatar gregory commented on June 24, 2024

same here. that's bad.

from dm-types.

ZeroChaos- avatar ZeroChaos- commented on June 24, 2024

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.

tpitale avatar tpitale commented on June 24, 2024

DM is mostly unmaintained. So, no, probably not getting fixed.

from dm-types.

jcran avatar jcran commented on June 24, 2024

Ran into this as well, accelerated a project's move off datamapper.

from dm-types.

joshleblanc avatar joshleblanc commented on June 24, 2024

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)

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.