Hey! Can you create a standalone script which shows the problem?
Thanks, # solnic On Oct 10, 11:48 am, Stefan Urbanek <[email protected]> wrote: > Hi, > > I am trying to use dm-contrains. When I include the dm-contrains file, > without any modification of any model class on first something.destroy > I get: > > /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/ > active_support/hash_with_indifferent_access.rb:45:in `[]=': can't add > a new key into hash during iteration (RuntimeError) > from /usr/local/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0/lib/ > active_support/hash_with_indifferent_access.rb:45:in `[]=' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > model/relationship.rb:127:in `has' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > support/hook.rb:325:in `block in has' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > support/hook.rb:323:in `catch' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > support/hook.rb:323:in `has' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > associations/many_to_many.rb:67:in `block in through' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core.rb: > 299:in `block in repository' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > repository.rb:114:in `scope' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core.rb: > 299:in `repository' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > associations/many_to_many.rb:66:in `through' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > associations/many_to_many.rb:114:in `links' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > associations/many_to_many.rb:136:in `query' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > associations/relationship.rb:155:in `block in query_for' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > repository.rb:114:in `scope' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > associations/relationship.rb:153:in `query_for' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > associations/one_to_many.rb:40:in `collection_for' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > associations/one_to_many.rb:100:in `lazy_load' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > associations/one_to_many.rb:57:in `get' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-constraints-1.0.2/lib/dm- > constraints/delete_constraint.rb:95:in `block in > check_delete_constraints' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-constraints-1.0.2/lib/dm- > constraints/delete_constraint.rb:93:in `each_value' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-constraints-1.0.2/lib/dm- > constraints/delete_constraint.rb:93:in `check_delete_constraints' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > model/hook.rb:91:in `call' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > resource.rb:1156:in `block in execute_hooks_for' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > resource.rb:1156:in `each' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > resource.rb:1156:in `execute_hooks_for' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > resource.rb:736:in `before_destroy_hook' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > resource.rb:444:in `block in destroy' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > resource.rb:443:in `catch' > from /usr/local/lib/ruby/gems/1.9.1/gems/dm-core-1.0.2/lib/dm-core/ > resource.rb:443:in `destroy' > > What do you think the problem might be? > > Thanks, > > Stefan -- 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.
