[Dbix-class] BUG? Unable to resolve relationship

Peter Rabbitson rabbit+dbic at rabbit.us
Sat Dec 12 10:21:18 GMT 2009

Zbigniew Lukasiak wrote:
> One additional question - what is the relation between 'belongs_to'
> and 'might_have' etc and 'add_relationship'?  I always thought that
> the first ones are only sugar for the last.  But unfortunately
> 'add_relationship' does not add an appropriate methods to the row
> class.

It does, you're just looking at the wrong one. Here is the rough chain
of events:

  ->  ::ResultSourceProxy::add_relationship()
    -> ::ResultSource::add_relationship()
    -> ::Relationship::ProxyMethods::register_relationship()
    -> ::Relationship::Accessor::register_relationship()
      -> ::Relationship::Accessor::add_relationship_accessor()

More information about the DBIx-Class mailing list