Hello all,

This link: 
http://datamapper.lighthouseapp.com/projects/20609/tickets/524-lazy-loading-error-in-through-associations
said, that error is fixed.

However, when I'm trying to access a Text field in a model (One-To-
Many-Through), I have error:
merb : worker (port 4000) ~ can't modify frozen array - (TypeError)
/usr/lib/ruby/gems/1.8/gems/extlib-0.9.9/lib/extlib/lazy_array.rb:
257:in `replace'
/usr/lib/ruby/gems/1.8/gems/extlib-0.9.9/lib/extlib/lazy_array.rb:
257:in `replace'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/collection.rb:
274:in `replace'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/collection.rb:
39:in `reload'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/resource.rb:
456:in `reload_attributes'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/resource.rb:
620:in `lazy_load'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/property.rb:
455:in `send'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/property.rb:
455:in `lazy_load'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/property.rb:
390:in `get'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/resource.rb:
106:in `attribute_get'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.9.9/lib/dm-core/model.rb:440:in
`annotation'
...

My models:
class Product
  include DataMapper::Resource

  storage_names[:default]='Products'
  property :id, Serial
  property :name, String, :length => 255
  property :article, String, :length => 60, :nullable => false
  property :created_on, DateTime, :nullable => false
  property :weight, Integer, :default => 1000000, :nullable => false
  property :quantity, Integer, :nullable => false
  property :price, Float, :nullable => false
  property :image_url, String, :length => 255, :nullable => false
  property :image_width, Integer, :nullable => false
  property :image_height, Integer, :nullable => false
  property :annotation, Text, :nullable => false, :lazy => true
  property :description, Text, :nullable => false, :lazy => true
  property :video, Boolean, :default => false, :nullable => false

        has n, :tagging
        has n, :tags, :through => :tagging
end

class Tag
  include DataMapper::Resource

  storage_names[:default]='Tags'
  property :id, Serial
  property :name, String, :length => 60, :nullable => false
  property :weight, Integer, :default => 0

  has n, :taglinks, :child_key => [:source_id]
  has n, :child_tags, :through => :taglinks, :class_name =>
"Tag", :child_key => [:target_id]
        has n, :tagging
        has n, :products, :through => :tagging
end

class Tagging
  include DataMapper::Resource

  storage_names[:default]='Tagging'
  property :product_id, Integer, :key => true, :nullable =>false
  property :tag_id, Integer, :key => true, :nullable =>false, :index
=> true
  property :weight, Integer, :nullable =>false, :index => true

        belongs_to :tag
        belongs_to :product
end

ps: if i disable lazy in Product model (:lazy => false) all OK.





--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"DataMapper" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/datamapper?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to