#524 ✓resolved
Zach Baker

Lazy loading error in through associations

Reported by Zach Baker | August 11th, 2008 @ 01:22 PM

Under 0.9.3, when attempting to access a Text field in a model through its associated model in a has-and-belongs-to-many structure, an error is raised:

<gems>/extlib-0.9.3/lib/extlib/lazy_array.rb:32:in `replace': can't modify frozen array (TypeError)
    from <gems>/extlib-0.9.3/lib/extlib/lazy_array.rb:32:in `replace'
    from <gems>/dm-core-0.9.3/lib/dm-core/collection.rb:273:in `replace'
    from <gems>/dm-core-0.9.3/lib/dm-core/collection.rb:39:in `reload'
    from <gems>/dm-core-0.9.3/lib/dm-core/resource.rb:445:in `reload_attributes'
    from <gems>/dm-core-0.9.3/lib/dm-core/resource.rb:588:in `lazy_load'
    from <gems>/dm-core-0.9.3/lib/dm-core/property.rb:435:in `send'
    from <gems>/dm-core-0.9.3/lib/dm-core/property.rb:435:in `lazy_load'
    from <gems>/dm-core-0.9.3/lib/dm-core/property.rb:377:in `get'
    from <gems>/dm-core-0.9.3/lib/dm-core/resource.rb:102:in `attribute_get'
    from <gems>/dm-core-0.9.3/lib/dm-core/model.rb:378:in `body'

Please see attachment for an example.

Comments and changes to this ticket

  • Dirkjan Bussink

    Dirkjan Bussink August 13th, 2008 @ 01:13 PM

    Afaik i already fixed this in the latest edge code. Could you check this?

  • ronin-22245 (at lighthouseapp)

    ronin-22245 (at lighthouseapp) August 14th, 2008 @ 03:55 AM

    Dirkjan: I'm affraid it's still broken. I'm using the latest dm-edge.

    ~ can't modify frozen array - (TypeError) /usr/local/lib/ruby/gems/1.8/gems/extlib-0.9.5/lib/extlib/lazy_array.rb:32:in replace' /usr/local/lib/ruby/gems/1.8/gems/extlib-0.9.5/lib/extlib/lazy_array.rb:32:inreplace' /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.4/lib/dm-core/collection.rb:273:in replace' /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.4/lib/dm-core/collection.rb:39:inreload' /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.4/lib/dm-core/resource.rb:448:in reload_attributes' /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.4/lib/dm-core/resource.rb:594:inlazy_load' /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.4/lib/dm-core/property.rb:435:in send' /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.4/lib/dm-core/property.rb:435:inlazy_load' /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.4/lib/dm-core/property.rb:377:in get' /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.4/lib/dm-core/resource.rb:102:inattribute_get' /usr/local/lib/ruby/gems/1.8/gems/dm-core-0.9.4/lib/dm-core/model.rb:393:in glossary'

  • comboy

    comboy November 11th, 2008 @ 09:39 AM

    still broken in the edge (0.9.7)

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) December 1st, 2008 @ 02:13 AM

    • State changed from “new” to “resolved”
    • Assigned user changed from “Sam Smoot” to “Dan Kubb (dkubb)”

    I have confirmed this is now fixed in dkubb/dm-core. Marking this ticket as closed.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »