};
}
else {
- $self->belongs_to($col, $f_class);
+ $self->refers_to($col, $f_class);
$rel_info = $self->result_source_instance->relationship_info($col);
}
# dunno
else {
$class->throw_exception(
- 'third argument for belongs_to must be undef, a column name, '.
+ 'third argument for refers_to must be undef, a column name, '.
'or a join condition'
);
}
unless $class->has_column($key);
my $column_info = $class->column_info($key);
if ( $column_info->{is_nullable} ) {
- carp(qq'"might_have/has_one" must not be on columns with is_nullable set to true ($class/$key). This might indicate an incorrect use of those relationship helpers instead of belongs_to.');
+ carp(qq'"might_have/has_one" must not be on columns with is_nullable set to true ($class/$key). This might indicate an incorrect use of those relationship helpers instead of refers_to.');
}
}
}
my @pks = $rsrc->primary_columns;
- ## do the belongs_to relationships
+ ## do the refers_to relationships
foreach my $index (0..$#$data) {
# delegate to create() for any dataset without primary keys with specified relationships
my @refkeys = map {/^\w+\.(\w+)$/} @cond;
my @keys = map {$rel_info->{cond}->{$_} =~ /^\w+\.(\w+)$/} @cond;
- # determine if this relationship is a self.fk => foreign.pk (i.e. belongs_to)
+ # determine if this relationship is a self.fk => foreign.pk (i.e. refers_to)
my $fk_constraint;
#first it can be specified explicitly
# print Data::Dumper::Dumper($cont->type);
if($cont->type =~ /foreign key/i)
{
-# $output .= "\n__PACKAGE__->belongs_to('" .
+# $output .= "\n__PACKAGE__->refers_to('" .
# $cont->fields->[0]->name . "', '" .
# "${dbixschema}::" . $cont->reference_table . "');\n";
- $tableextras{$table->name} .= "\n__PACKAGE__->belongs_to('" .
+ $tableextras{$table->name} .= "\n__PACKAGE__->refers_to('" .
$cont->fields->[0]->name . "', '" .
"${dbixschema}::" . $cont->reference_table . "');\n";