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
-~----------~----~----~----~------~----~------~--~---