Table PROJECT id (primary key for the table) ... Table ACCOUNT id (primary key for the table) project_id (reference to PROJECT.id) ... Table QUOTA id (primary key for the table) account_id (reference to ACCOUNT.id) ... #### Quota->belongs_to(account => 'Account'); Account->belongs_to(project => 'Project'); #### my $project_from_quota = $quota->account()->project(); #### package Quota; sub project { return shift->account()->project() } #... my $project_from_quota = $quota->project();