2009/6/26 Roy Wright <[email protected]>:
>
> On Jun 26, 2009, at 4:09 AM, roovo wrote:
>
> has n, :authors, User, :through => :author_joins
>
>
> Take a look at:
>  http://datamapper.org/doku.php?id=docs:associations

Many thanks Roy

Having looked through that it seems that the problem is that there is
no longer any :remote_name option for the has association so it's not
able to find the target in the join model.  The way it works according
to the help page is:

has n, :authors, User,  :through => :author_joins, :remote_name =>
:user, :child_key => [:paper_id]

but this gives the same error :(

I've found I can work around it by changing the association in the join model:

class AuthorJoin
  include DataMapper::Resource

  property :id,       Serial
  property :user_id,  Integer
  property :paper_id, Integer

  belongs_to :author, :model => "User"
  belongs_to :paper
end

So I guess the question is, is the :remote_name omission a bug which I
should file a ticket for or should this situation be handled in the
way I've done it (or a better way I've not thought of)?

Cheers and thanks again

Rupert
-- 
roovoweb.com

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