I noticed two things here.

The first is that the code that generates the anonymous join table
relationship name mishandles the package (doesn't expect it?).

The next is that none of the rspec files that I looked at for
relationship examples include a class inside a module.


On Aug 24, 10:13 am, David Richards <[EMAIL PROTECTED]> wrote:
> I took your code yesterday to play with it.  All I could do was
> confirm what you're finding without any real insight about the
> problem.  So, +1 here.
>
> On Aug 22, 1:48 pm, Mike Summers <[EMAIL PROTECTED]> wrote:
>
> > With DM 0.9.3 gem this code:
>
> > require 'rubygems'
> > require 'datamapper'
> > module Foo
> >   class TestOne
> >     include DataMapper::Resource
> >     property :id, Integer, :key => true
> >     has n, :TestTwos, :through => Resource
> >   end
> >   class TestTwo
> >     include DataMapper::Resource
> >     property :id, Integer, :key => true
> >     has n, :TestOnes, :through => Resource
> >   end
> > end
> > DataMapper.setup(:default, {
> >     :adapter  => 'mysql',
> >     ...
> >   })
> > DataMapper.auto_migrate!
>
> > Generates this error:
> > /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.3/lib/dm-core/associations/
> > one_to_many.rb:17:in `setup': compile error (SyntaxError)
> > /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.3/lib/dm-core/associations/
> > one_to_many.rb:15: syntax error, unexpected '/', expecting '\n' or ';'
> >           def foo/test_one_test_twos(query = {})
> >                   ^
> > /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.3/lib/dm-core/associations/
> > one_to_many.rb:17: syntax error, unexpected kEND, expecting $end        
> > from /
> > usr/lib/ruby/gems/1.8/gems/dm-core-0.9.3/lib/dm-core/associations.rb:
> > 121:in `has'
> >         from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.3/lib/dm-core/
> > associations/many_to_many.rb:56:in `setup'
> >         from /usr/lib/ruby/gems/1.8/gems/dm-core-0.9.3/lib/dm-core/
> > associations.rb:121:in `has'
> >         from /home/mike/NetBeansProjects/FB/test/dmRepositoryTest.rb:8
>
> > If I drop the module it works fine. Is this a known problem? I
> > couldn't find anything that looked similar in Lighthouse.
>
> > Thanks-- Mike
--~--~---------~--~----~------------~-------~--~----~
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