Francis: I'm and newcomer to DataMapper myself; I'm having the same issue that I'm trying to debug now... The offending code line 60 in many_to_many.rb breaks as the ruby methods Module.const_defined?, .const_get, .const_set are not namespace aware. However, even when you workaround that line, it still breaks for reasons that I'm still working on... Any thoughts from datamapper developers?
Thanks, Paul On Sep 11, 1:16 pm, Francis Joanis <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm quite new to DataMapper and while implementing my model I > encountered the following error when trying to implement a many-to- > many relationship with objects that are within namespaces. > > I am running dm-core from the git master. I also saw that two tickets > (that could be related) had been opened on the bug tracker (tickets > 202/203). > > The error is: > > /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/associations/ > many_to_many.rb:60:in `const_defined?': wrong constant name > Circus::Show::ClownMask (NameError) > from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/ > associations/many_to_many.rb:60:in `setup' > from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/ > associations.rb:122:in `has' > from circus.rb:10 > > Here's the example code (sorry if it looks lame :) ): > > (CODE_BEGIN) > require 'rubygems' > require 'dm-core' > > module Circus > module Show > > class Clown > include DataMapper::Resource > property :id, Serial > has n, :masks, :through => Resource > end > > class Mask > include DataMapper::Resource > property :id, Serial > has n, :clowns, :through => Resource > end > > end > end > > DataMapper.setup(:default, 'sqlite3::memory:') > DataMapper.auto_migrate!() > (CODE_END) > > Note that if I remove the Circus and Show namespaces, everything seems > to work fine. > > Thanks, > Francis --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
