#628 ✓resolved
David Dai

DataMapper::Associations::ManyToOne::Proxy#class is not being forwarded to parent.

Reported by David Dai | October 31st, 2008 @ 01:29 AM

When using belongs_to association, the instance method #class is not being forwarded to the parent object. This is currently breaking Merb's resource() helper method since resource() uses object.class.to_s to key into its routes. For example, given a association where an article belongs to its author: resource(article.author) will always lead to a missing route. This is due to article.author.class is returning DataMapper::Associations::ManyToOne::Proxy instead of the expected Author. I've attached a patch with the appropriate spec as requested by Dan Kubb. Thanks Dan, for all your help.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Attachments

Referenced by

Pages