Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rename occurences of belongs_to in tests

  • Loading branch information...
commit f54cb4d66292431efc26b4d14b22ebf9228cc7b9 1 parent 5d22bb7
@wchristian wchristian authored
Showing with 98 additions and 98 deletions.
  1. +5 −5 t/101populate_rs.t
  2. +2 −2 t/103many_to_many_warning.t
  3. +1 −1  t/71mysql.t
  4. +1 −1  t/73oracle_hq.t
  5. +1 −1  t/746mssql.t
  6. +1 −1  t/inflate/hri.t
  7. +2 −2 t/lib/DBICTest/Schema/ArtistUndirectedMap.pm
  8. +1 −1  t/lib/DBICTest/Schema/Artwork.pm
  9. +4 −4 t/lib/DBICTest/Schema/Artwork_to_Artist.pm
  10. +1 −1  t/lib/DBICTest/Schema/Bookmark.pm
  11. +1 −1  t/lib/DBICTest/Schema/BooksInLibrary.pm
  12. +5 −5 t/lib/DBICTest/Schema/CD.pm
  13. +2 −2 t/lib/DBICTest/Schema/CD_to_Producer.pm
  14. +2 −2 t/lib/DBICTest/Schema/CollectionObject.pm
  15. +1 −1  t/lib/DBICTest/Schema/Employee.pm
  16. +1 −1  t/lib/DBICTest/Schema/ForceForeign.pm
  17. +2 −2 t/lib/DBICTest/Schema/FourKeys_to_TwoKeys.pm
  18. +1 −1  t/lib/DBICTest/Schema/Image.pm
  19. +1 −1  t/lib/DBICTest/Schema/LinerNotes.pm
  20. +1 −1  t/lib/DBICTest/Schema/LyricVersion.pm
  21. +1 −1  t/lib/DBICTest/Schema/Lyrics.pm
  22. +2 −2 t/lib/DBICTest/Schema/SelfRefAlias.pm
  23. +1 −1  t/lib/DBICTest/Schema/Tag.pm
  24. +4 −4 t/lib/DBICTest/Schema/Track.pm
  25. +1 −1  t/lib/DBICTest/Schema/TreeLike.pm
  26. +1 −1  t/lib/DBICTest/Schema/TwoKeyTreeLike.pm
  27. +2 −2 t/lib/DBICTest/Schema/TwoKeys.pm
  28. +1 −1  t/lib/DBICTest/Schema/Year1999CDs.pm
  29. +1 −1  t/lib/DBICTest/Schema/Year2000CDs.pm
  30. +2 −2 t/lib/PrefetchBug/LeftRight.pm
  31. +1 −1  t/lib/ViewDeps/Result/Artwork.pm
  32. +1 −1  t/lib/ViewDeps/Result/CD.pm
  33. +1 −1  t/lib/ViewDeps/Result/Track.pm
  34. +1 −1  t/lib/ViewDeps/Result/TrackNumberFives.pm
  35. +1 −1  t/lib/ViewDeps/Result/Year2010CDs.pm
  36. +1 −1  t/lib/ViewDeps/Result/Year2010CDsWithManyTracks.pm
  37. +1 −1  t/lib/ViewDepsBad/Result/Artwork.pm
  38. +1 −1  t/lib/ViewDepsBad/Result/CD.pm
  39. +1 −1  t/lib/ViewDepsBad/Result/Track.pm
  40. +1 −1  t/lib/ViewDepsBad/Result/TrackNumberFives.pm
  41. +1 −1  t/lib/ViewDepsBad/Result/Year2010CDs.pm
  42. +1 −1  t/lib/ViewDepsBad/Result/Year2010CDsWithManyTracks.pm
  43. +2 −2 t/multi_create/diamond.t
  44. +1 −1  t/multi_create/in_memory.t
  45. +1 −1  t/multi_create/standard.t
  46. +1 −1  t/prefetch/diamond.t
  47. +1 −1  t/prefetch/grouped.t
  48. +1 −1  t/prefetch/join_type.t
  49. +3 −3 t/prefetch/o2m_o2m_order_by_with_limit.t
  50. +2 −2 t/prefetch/standard.t
  51. +6 −6 t/relationship/core.t
  52. +3 −3 t/relationship/custom.t
  53. +6 −6 t/relationship/info.t
  54. +7 −7 t/relationship/set_column_on_fk.t
View
10 t/101populate_rs.t
@@ -2,7 +2,7 @@
## Tests for the $resultset->populate method.
##
## GOALS: We need to test the method for both void and array context for all
-## the following relationship types: belongs_to, has_many. Additionally we
+## the following relationship types: refers_to, has_many. Additionally we
## need to test each of those for both specified PK's and autogenerated PK's
##
## Also need to test some stuff that should generate errors.
@@ -272,7 +272,7 @@ ARRAY_CONTEXT: {
BELONGS_TO_NO_PKs: {
- ## Test from a belongs_to perspective, should create artist first,
+ ## Test from a refers_to perspective, should create artist first,
## then CD with artistid. This test we let the system automatically
## create the PK's. Chances are good you'll use it this way mostly.
@@ -304,7 +304,7 @@ ARRAY_CONTEXT: {
BELONGS_TO_WITH_PKs: {
- ## Test from a belongs_to perspective, should create artist first,
+ ## Test from a refers_to perspective, should create artist first,
## then CD with artistid. This time we try setting the PK's
my $aid = $art_rs->get_column('artistid')->max || 0;
@@ -455,7 +455,7 @@ VOID_CONTEXT: {
BELONGS_TO_WITH_PKs: {
- ## Test from a belongs_to perspective, should create artist first,
+ ## Test from a refers_to perspective, should create artist first,
## then CD with artistid. This time we try setting the PK's
my $aid = $art_rs->get_column('artistid')->max || 0;
@@ -492,7 +492,7 @@ VOID_CONTEXT: {
BELONGS_TO_NO_PKs: {
- ## Test from a belongs_to perspective, should create artist first,
+ ## Test from a refers_to perspective, should create artist first,
## then CD with artistid.
my $cds = [
View
4 t/103many_to_many_warning.t
@@ -74,8 +74,8 @@ use warnings;
data_type => 'integer',
},
);
- __PACKAGE__->belongs_to('foo' => 'DBICTest::Schema::Foo${suffix}');
- __PACKAGE__->belongs_to('bar' => 'DBICTest::Schema::Foo${suffix}');
+ __PACKAGE__->refers_to('foo' => 'DBICTest::Schema::Foo${suffix}');
+ __PACKAGE__->refers_to('bar' => 'DBICTest::Schema::Foo${suffix}');
}
{
package #
View
2  t/71mysql.t
@@ -158,7 +158,7 @@ $schema->populate ('BooksInLibrary', [
is ($_->count, 2, 'Prefetched grouped search returns correct count');
}
- # try a ->belongs_to direction (no select collapse)
+ # try a ->refers_to direction (no select collapse)
my $books = $schema->resultset ('BooksInLibrary')->search (
{ 'owner.name' => 'wiggle' },
{ prefetch => 'owner', distinct => 1 }
View
2  t/73oracle_hq.t
@@ -33,7 +33,7 @@ BEGIN {
{ 'foreign.parentid' => 'self.artistid' }
);
- DBICTest::Schema::Artist->belongs_to(
+ DBICTest::Schema::Artist->refers_to(
parent => 'DBICTest::Schema::Artist',
{ 'foreign.artistid' => 'self.parentid' }
);
View
2  t/746mssql.t
@@ -406,7 +406,7 @@ SQL
}
- # try a ->belongs_to direction (no select collapse, group_by should work)
+ # try a ->refers_to direction (no select collapse, group_by should work)
my $books = $schema->resultset ('BooksInLibrary')->search (
{
'owner.name' => [qw/wiggle woggle/],
View
2  t/inflate/hri.t
@@ -78,7 +78,7 @@ sub check_cols_of {
if (not ref ($datahashref->{$col}) ) {
is ($datahashref->{$col}, $dbic_obj->get_column($col), 'same value');
}
- # related table entry (belongs_to)
+ # related table entry (refers_to)
elsif (ref ($datahashref->{$col}) eq 'HASH') {
check_cols_of($dbic_obj->$col, $datahashref->{$col});
}
View
4 t/lib/DBICTest/Schema/ArtistUndirectedMap.pm
@@ -13,8 +13,8 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/id1 id2/);
-__PACKAGE__->belongs_to( 'artist1', 'DBICTest::Schema::Artist', 'id1', { on_delete => 'RESTRICT', on_update => 'CASCADE'} );
-__PACKAGE__->belongs_to( 'artist2', 'DBICTest::Schema::Artist', 'id2', { on_delete => undef, on_update => undef} );
+__PACKAGE__->refers_to( 'artist1', 'DBICTest::Schema::Artist', 'id1', { on_delete => 'RESTRICT', on_update => 'CASCADE'} );
+__PACKAGE__->refers_to( 'artist2', 'DBICTest::Schema::Artist', 'id2', { on_delete => undef, on_update => undef} );
__PACKAGE__->has_many(
'mapped_artists', 'DBICTest::Schema::Artist',
[ {'foreign.artistid' => 'self.id1'}, {'foreign.artistid' => 'self.id2'} ],
View
2  t/lib/DBICTest/Schema/Artwork.pm
@@ -15,7 +15,7 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key('cd_id');
-__PACKAGE__->belongs_to('cd', 'DBICTest::Schema::CD', 'cd_id');
+__PACKAGE__->refers_to('cd', 'DBICTest::Schema::CD', 'cd_id');
__PACKAGE__->has_many('images', 'DBICTest::Schema::Image', 'artwork_id');
__PACKAGE__->has_many('artwork_to_artist', 'DBICTest::Schema::Artwork_to_Artist', 'artwork_cd_id');
View
8 t/lib/DBICTest/Schema/Artwork_to_Artist.pm
@@ -19,10 +19,10 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key(qw/artwork_cd_id artist_id/);
-__PACKAGE__->belongs_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_cd_id');
-__PACKAGE__->belongs_to('artist', 'DBICTest::Schema::Artist', 'artist_id');
+__PACKAGE__->refers_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_cd_id');
+__PACKAGE__->refers_to('artist', 'DBICTest::Schema::Artist', 'artist_id');
-__PACKAGE__->belongs_to('artist_test_m2m', 'DBICTest::Schema::Artist',
+__PACKAGE__->refers_to('artist_test_m2m', 'DBICTest::Schema::Artist',
sub {
my $args = shift;
@@ -46,7 +46,7 @@ __PACKAGE__->belongs_to('artist_test_m2m', 'DBICTest::Schema::Artist',
}
);
-__PACKAGE__->belongs_to('artist_test_m2m_noopt', 'DBICTest::Schema::Artist',
+__PACKAGE__->refers_to('artist_test_m2m_noopt', 'DBICTest::Schema::Artist',
sub {
my $args = shift;
View
2  t/lib/DBICTest/Schema/Bookmark.pm
@@ -21,7 +21,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
require DBICTest::Schema::Link; # so we can get a columnlist
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
link => 'DBICTest::Schema::Link', 'link', {
on_delete => 'SET NULL',
join_type => 'LEFT',
View
2  t/lib/DBICTest/Schema/BooksInLibrary.pm
@@ -34,6 +34,6 @@ __PACKAGE__->add_unique_constraint (['title']);
__PACKAGE__->resultset_attributes({where => { source => "Library" } });
-__PACKAGE__->belongs_to ( owner => 'DBICTest::Schema::Owners', 'owner' );
+__PACKAGE__->refers_to ( owner => 'DBICTest::Schema::Owners', 'owner' );
1;
View
10 t/lib/DBICTest/Schema/CD.pm
@@ -40,16 +40,16 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('cdid');
__PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
-__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist', undef, {
+__PACKAGE__->refers_to( artist => 'DBICTest::Schema::Artist', undef, {
is_deferrable => 1,
proxy => { artist_name => 'name' },
});
-__PACKAGE__->belongs_to( very_long_artist_relationship => 'DBICTest::Schema::Artist', 'artist', {
+__PACKAGE__->refers_to( very_long_artist_relationship => 'DBICTest::Schema::Artist', 'artist', {
is_deferrable => 1,
});
# in case this is a single-cd it promotes a track from another cd
-__PACKAGE__->belongs_to( single_track => 'DBICTest::Schema::Track', 'single_track',
+__PACKAGE__->refers_to( single_track => 'DBICTest::Schema::Track', 'single_track',
{ join_type => 'left'}
);
@@ -75,7 +75,7 @@ __PACKAGE__->many_to_many(
{ order_by => 'producer.name' },
);
-__PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre',
+__PACKAGE__->refers_to('genre', 'DBICTest::Schema::Genre',
{ 'foreign.genreid' => 'self.genreid' },
{
join_type => 'left',
@@ -86,7 +86,7 @@ __PACKAGE__->belongs_to('genre', 'DBICTest::Schema::Genre',
#This second relationship was added to test the short-circuiting of pointless
#queries provided by undef_on_null_fk. the relevant test in 66relationship.t
-__PACKAGE__->belongs_to('genre_inefficient', 'DBICTest::Schema::Genre',
+__PACKAGE__->refers_to('genre_inefficient', 'DBICTest::Schema::Genre',
{ 'foreign.genreid' => 'self.genreid' },
{
join_type => 'left',
View
4 t/lib/DBICTest/Schema/CD_to_Producer.pm
@@ -14,12 +14,12 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/cd producer/);
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
'cd', 'DBICTest::Schema::CD',
{ 'foreign.cdid' => 'self.cd' }
);
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
'producer', 'DBICTest::Schema::Producer',
{ 'foreign.producerid' => 'self.producer' },
{ on_delete => undef, on_update => undef },
View
4 t/lib/DBICTest/Schema/CollectionObject.pm
@@ -17,10 +17,10 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/collection object/);
-__PACKAGE__->belongs_to( collection => "DBICTest::Schema::Collection",
+__PACKAGE__->refers_to( collection => "DBICTest::Schema::Collection",
{ "foreign.collectionid" => "self.collection" }
);
-__PACKAGE__->belongs_to( object => "DBICTest::Schema::TypedObject",
+__PACKAGE__->refers_to( object => "DBICTest::Schema::TypedObject",
{ "foreign.objectid" => "self.object" }
);
View
2  t/lib/DBICTest/Schema/Employee.pm
@@ -47,7 +47,7 @@ __PACKAGE__->position_column('position');
# Do not add unique constraints here - different groups are used throughout
# the ordered tests
-__PACKAGE__->belongs_to (secretkey => 'DBICTest::Schema::Encoded', 'encoded', {
+__PACKAGE__->refers_to (secretkey => 'DBICTest::Schema::Encoded', 'encoded', {
join_type => 'left'
});
View
2  t/lib/DBICTest/Schema/ForceForeign.pm
@@ -27,7 +27,7 @@ __PACKAGE__->might_have('cd_1', 'DBICTest::Schema::CD',
);
# Normally this would appear as a FK constraint
-__PACKAGE__->belongs_to('cd_3', 'DBICTest::Schema::CD',
+__PACKAGE__->refers_to('cd_3', 'DBICTest::Schema::CD',
{ 'foreign.cdid' => 'self.cd' },
{ is_foreign_key_constraint => 0 },
);
View
4 t/lib/DBICTest/Schema/FourKeys_to_TwoKeys.pm
@@ -21,14 +21,14 @@ __PACKAGE__->set_primary_key(
qw/f_foo f_bar f_hello f_goodbye t_artist t_cd/
);
-__PACKAGE__->belongs_to('fourkeys', 'DBICTest::Schema::FourKeys', {
+__PACKAGE__->refers_to('fourkeys', 'DBICTest::Schema::FourKeys', {
'foreign.foo' => 'self.f_foo',
'foreign.bar' => 'self.f_bar',
'foreign.hello' => 'self.f_hello',
'foreign.goodbye' => 'self.f_goodbye',
});
-__PACKAGE__->belongs_to('twokeys', 'DBICTest::Schema::TwoKeys', {
+__PACKAGE__->refers_to('twokeys', 'DBICTest::Schema::TwoKeys', {
'foreign.artist' => 'self.t_artist',
'foreign.cd' => 'self.t_cd',
});
View
2  t/lib/DBICTest/Schema/Image.pm
@@ -26,6 +26,6 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_id');
+__PACKAGE__->refers_to('artwork', 'DBICTest::Schema::Artwork', 'artwork_id');
1;
View
2  t/lib/DBICTest/Schema/LinerNotes.pm
@@ -17,7 +17,7 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key('liner_id');
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
'cd', 'DBICTest::Schema::CD', 'liner_id'
);
View
2  t/lib/DBICTest/Schema/LyricVersion.pm
@@ -22,6 +22,6 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to('lyric', 'DBICTest::Schema::Lyrics', 'lyric_id');
+__PACKAGE__->refers_to('lyric', 'DBICTest::Schema::Lyrics', 'lyric_id');
1;
View
2  t/lib/DBICTest/Schema/Lyrics.pm
@@ -18,7 +18,7 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key('lyric_id');
-__PACKAGE__->belongs_to('track', 'DBICTest::Schema::Track', 'track_id');
+__PACKAGE__->refers_to('track', 'DBICTest::Schema::Track', 'track_id');
__PACKAGE__->has_many('lyric_versions', 'DBICTest::Schema::LyricVersion', 'lyric_id');
1;
View
4 t/lib/DBICTest/Schema/SelfRefAlias.pm
@@ -17,7 +17,7 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/self_ref alias/);
-__PACKAGE__->belongs_to( self_ref => 'DBICTest::Schema::SelfRef' );
-__PACKAGE__->belongs_to( alias => 'DBICTest::Schema::SelfRef' );
+__PACKAGE__->refers_to( self_ref => 'DBICTest::Schema::SelfRef' );
+__PACKAGE__->refers_to( alias => 'DBICTest::Schema::SelfRef' );
1;
View
2  t/lib/DBICTest/Schema/Tag.pm
@@ -31,7 +31,7 @@ __PACKAGE__->add_unique_constraints( # do not remove, part of a test
[qw/ tagid tag cd /],
);
-__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD', 'cd', {
+__PACKAGE__->refers_to( cd => 'DBICTest::Schema::CD', 'cd', {
proxy => [ 'year', { cd_title => 'title' } ],
});
View
8 t/lib/DBICTest/Schema/Track.pm
@@ -49,23 +49,23 @@ __PACKAGE__->position_column ('position');
__PACKAGE__->grouping_column ('cd');
-__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD', undef, {
+__PACKAGE__->refers_to( cd => 'DBICTest::Schema::CD', undef, {
proxy => { cd_title => 'title' },
});
-__PACKAGE__->belongs_to( disc => 'DBICTest::Schema::CD' => 'cd', {
+__PACKAGE__->refers_to( disc => 'DBICTest::Schema::CD' => 'cd', {
proxy => 'year'
});
__PACKAGE__->might_have( cd_single => 'DBICTest::Schema::CD', 'single_track' );
__PACKAGE__->might_have( lyrics => 'DBICTest::Schema::Lyrics', 'track_id' );
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
"year1999cd",
"DBICTest::Schema::Year1999CDs",
{ "foreign.cdid" => "self.cd" },
{ join_type => 'left' }, # the relationship is of course optional
);
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
"year2000cd",
"DBICTest::Schema::Year2000CDs",
{ "foreign.cdid" => "self.cd" },
View
2  t/lib/DBICTest/Schema/TreeLike.pm
@@ -15,7 +15,7 @@ __PACKAGE__->add_columns(
},
);
__PACKAGE__->set_primary_key(qw/id/);
-__PACKAGE__->belongs_to('parent', 'TreeLike',
+__PACKAGE__->refers_to('parent', 'TreeLike',
{ 'foreign.id' => 'self.parent' });
__PACKAGE__->has_many('children', 'TreeLike', { 'foreign.parent' => 'self.id' });
View
2  t/lib/DBICTest/Schema/TwoKeyTreeLike.pm
@@ -18,7 +18,7 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/id1 id2/);
__PACKAGE__->add_unique_constraint('tktlnameunique' => ['name']);
-__PACKAGE__->belongs_to('parent', 'DBICTest::Schema::TwoKeyTreeLike',
+__PACKAGE__->refers_to('parent', 'DBICTest::Schema::TwoKeyTreeLike',
{ 'foreign.id1' => 'self.parent1', 'foreign.id2' => 'self.parent2'});
1;
View
4 t/lib/DBICTest/Schema/TwoKeys.pm
@@ -13,12 +13,12 @@ __PACKAGE__->add_columns(
);
__PACKAGE__->set_primary_key(qw/artist cd/);
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(
artist => 'DBICTest::Schema::Artist',
{'foreign.artistid'=>'self.artist'},
);
-__PACKAGE__->belongs_to( cd => 'DBICTest::Schema::CD', undef, { is_deferrable => 0, add_fk_index => 0 } );
+__PACKAGE__->refers_to( cd => 'DBICTest::Schema::CD', undef, { is_deferrable => 0, add_fk_index => 0 } );
__PACKAGE__->has_many(
'fourkeys_to_twokeys', 'DBICTest::Schema::FourKeys_to_TwoKeys', {
View
2  t/lib/DBICTest/Schema/Year1999CDs.pm
@@ -35,7 +35,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('cdid');
__PACKAGE__->add_unique_constraint([ qw/artist title/ ]);
-__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
+__PACKAGE__->refers_to( artist => 'DBICTest::Schema::Artist' );
__PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track',
{ "foreign.cd" => "self.cdid" });
View
2  t/lib/DBICTest/Schema/Year2000CDs.pm
@@ -15,7 +15,7 @@ __PACKAGE__->result_source_instance->view_definition( sprintf (
join (', ', __PACKAGE__->columns),
));
-__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
+__PACKAGE__->refers_to( artist => 'DBICTest::Schema::Artist' );
__PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track',
{ "foreign.cd" => "self.cdid" });
View
4 t/lib/PrefetchBug/LeftRight.pm
@@ -13,8 +13,8 @@ __PACKAGE__->add_columns(
value => {});
__PACKAGE__->set_primary_key('left_id', 'right_id');
-__PACKAGE__->belongs_to(left => 'PrefetchBug::Left', 'left_id');
-__PACKAGE__->belongs_to(
+__PACKAGE__->refers_to(left => 'PrefetchBug::Left', 'left_id');
+__PACKAGE__->refers_to(
right => 'PrefetchBug::Right',
'right_id',
# {join_type => 'left'}
View
2  t/lib/ViewDeps/Result/Artwork.pm
@@ -15,7 +15,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'cd', 'ViewDeps::Result::CD',
+__PACKAGE__->refers_to( 'cd', 'ViewDeps::Result::CD',
{ "foreign.id" => "self.cd" },
);
View
2  t/lib/ViewDeps/Result/CD.pm
@@ -17,7 +17,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'artist', 'ViewDeps::Result::Artist',
+__PACKAGE__->refers_to( 'artist', 'ViewDeps::Result::Artist',
{ "foreign.id" => "self.artist" },
);
View
2  t/lib/ViewDeps/Result/Track.pm
@@ -16,7 +16,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'cd', 'ViewDeps::Result::CD',
+__PACKAGE__->refers_to( 'cd', 'ViewDeps::Result::CD',
{ "foreign.id" => "self.cd" },
);
View
2  t/lib/ViewDeps/Result/TrackNumberFives.pm
@@ -19,7 +19,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'cd', 'ViewDeps::Result::CD',
+__PACKAGE__->refers_to( 'cd', 'ViewDeps::Result::CD',
{ "foreign.id" => "self.cd" },
);
View
2  t/lib/ViewDeps/Result/Year2010CDs.pm
@@ -20,7 +20,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'artist', 'ViewDeps::Result::Artist',
+__PACKAGE__->refers_to( 'artist', 'ViewDeps::Result::Artist',
{ "foreign.id" => "self.artist" },
);
View
2  t/lib/ViewDeps/Result/Year2010CDsWithManyTracks.pm
@@ -25,7 +25,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'artist', 'ViewDeps::Result::Artist',
+__PACKAGE__->refers_to( 'artist', 'ViewDeps::Result::Artist',
{ "foreign.id" => "self.artist" },
);
View
2  t/lib/ViewDepsBad/Result/Artwork.pm
@@ -15,7 +15,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'cd', 'ViewDepsBad::Result::CD',
+__PACKAGE__->refers_to( 'cd', 'ViewDepsBad::Result::CD',
{ "foreign.id" => "self.cd" },
);
View
2  t/lib/ViewDepsBad/Result/CD.pm
@@ -17,7 +17,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'artist', 'ViewDepsBad::Result::Artist',
+__PACKAGE__->refers_to( 'artist', 'ViewDepsBad::Result::Artist',
{ "foreign.id" => "self.artist" },
);
View
2  t/lib/ViewDepsBad/Result/Track.pm
@@ -16,7 +16,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'cd', 'ViewDepsBad::Result::CD',
+__PACKAGE__->refers_to( 'cd', 'ViewDepsBad::Result::CD',
{ "foreign.id" => "self.cd" },
);
View
2  t/lib/ViewDepsBad/Result/TrackNumberFives.pm
@@ -19,7 +19,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'cd', 'ViewDepsBad::Result::CD',
+__PACKAGE__->refers_to( 'cd', 'ViewDepsBad::Result::CD',
{ "foreign.id" => "self.cd" },
);
View
2  t/lib/ViewDepsBad/Result/Year2010CDs.pm
@@ -20,7 +20,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'artist', 'ViewDepsBad::Result::Artist',
+__PACKAGE__->refers_to( 'artist', 'ViewDepsBad::Result::Artist',
{ "foreign.id" => "self.artist" },
);
View
2  t/lib/ViewDepsBad/Result/Year2010CDsWithManyTracks.pm
@@ -25,7 +25,7 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key('id');
-__PACKAGE__->belongs_to( 'artist', 'ViewDepsBad::Result::Artist',
+__PACKAGE__->refers_to( 'artist', 'ViewDepsBad::Result::Artist',
{ "foreign.id" => "self.artist" },
);
View
4 t/multi_create/diamond.t
@@ -13,9 +13,9 @@ my $schema = DBICTest->init_schema();
mc_diag (<<'DG');
* Try a diamond multicreate
-Artist -> has_many -> Artwork_to_Artist -> belongs_to
+Artist -> has_many -> Artwork_to_Artist -> refers_to
/
- belongs_to <- CD <- belongs_to <- Artwork <-/
+ refers_to <- CD <- refers_to <- Artwork <-/
\
\-> Artist2
View
2  t/multi_create/in_memory.t
@@ -74,7 +74,7 @@ my $schema = DBICTest->init_schema();
# test both sides of a 1:(1|0)
{
- for my $reldir ('might_have', 'belongs_to') {
+ for my $reldir ('might_have', 'refers_to') {
my $artist = $schema->resultset('Artist')->next;
my $new_track = $schema->resultset('Track')->new ({
View
2  t/multi_create/standard.t
@@ -22,7 +22,7 @@ lives_ok ( sub {
isa_ok($cd, 'DBICTest::CD', 'Created CD object');
isa_ok($cd->artist, 'DBICTest::Artist', 'Created related Artist');
is($cd->artist->name, 'Fred Bloggs', 'Artist created correctly');
-}, 'simple create + parent (the stuff $rs belongs_to) ok');
+}, 'simple create + parent (the stuff $rs refers_to) ok');
lives_ok ( sub {
my $bm_rs = $schema->resultset('Bookmark');
View
2  t/prefetch/diamond.t
@@ -28,7 +28,7 @@ my $ars = $schema->resultset ('Artwork');
# V V
# cd ------> artist
#
-# The current artwork belongs to a cd by artist1
+# The current artwork refers to a cd by artist1
# but the artwork itself is painted by artist2
#
# What we try is all possible permutations of join/prefetch
View
2  t/prefetch/grouped.t
@@ -24,7 +24,7 @@ for ($cd_rs->all) {
is ($_->tracks->count, 3, '3 tracks for CD' . $_->id );
}
-# Test a belongs_to prefetch of a has_many
+# Test a refers_to prefetch of a has_many
{
my $track_rs = $schema->resultset ('Track')->search (
{ 'me.cd' => { -in => [ $cd_rs->get_column ('cdid')->all ] } },
View
2  t/prefetch/join_type.t
@@ -9,7 +9,7 @@ use DBICTest;
my $schema = DBICTest->init_schema();
-# a regular belongs_to prefetch
+# a regular refers_to prefetch
my $cds = $schema->resultset('CD')->search ({}, { prefetch => 'artist' } );
my $nulls = {
View
6 t/prefetch/o2m_o2m_order_by_with_limit.t
@@ -61,10 +61,10 @@ is_same_sql_bind(
# note: we only requested "get all cds of all artists with rank 13 then order
# by the artist name and give me the fourth, fifth and sixth", consequently the
-# cds that belong to the same artist are unordered; fortunately we know that
+# cds that refer to the same artist are unordered; fortunately we know that
# the first artist have 3 cds and the second and third artist both have only
-# one, so the first 3 cds belong to the first artist and the fourth and fifth
-# cds belong to the second and third artist, respectively, and there's no sixth
+# one, so the first 3 cds refer to the first artist and the fourth and fifth
+# cds refer to the second and third artist, respectively, and there's no sixth
# row
is_deeply (
$filtered_cd_rs->all_hri,
View
4 t/prefetch/standard.t
@@ -71,9 +71,9 @@ $queries = 0;
is($tag->search_related('cd')->search_related('artist')->first->name,
'Caterwauler McCrae',
- 'chained belongs_to->belongs_to search_related ok');
+ 'chained refers_to->refers_to search_related ok');
-is($queries, 0, 'chained search_related after belontgs_to->belongs_to prefetch ran no queries');
+is($queries, 0, 'chained search_related after refers_to->refers_to prefetch ran no queries');
$queries = 0;
View
12 t/relationship/core.t
@@ -54,9 +54,9 @@ is( $big_flop_cd->title, 'Big Flop', 'create_related ok' );
$schema->storage->debugcb(sub { $queries++; });
$schema->storage->debug(1);
$big_flop_cd->genre; #should not trigger a select query
- is($queries, 0, 'No SELECT made for belongs_to if key IS NULL');
+ is($queries, 0, 'No SELECT made for refers_to if key IS NULL');
$big_flop_cd->genre_inefficient; #should trigger a select query
- is($queries, 1, 'SELECT made for belongs_to if key IS NULL when undef_on_null_fk disabled');
+ is($queries, 1, 'SELECT made for refers_to if key IS NULL when undef_on_null_fk disabled');
$schema->storage->debug($sdebug);
$schema->storage->debugcb(undef);
}
@@ -295,7 +295,7 @@ my $trackset = $artist->cds->search_related('tracks');
is($trackset->count, 10, "Correct number of tracks for artist");
is($trackset->all, 10, "Correct number of track objects for artist");
-# now see about updating eveything that belongs to artist 2 to artist 3
+# now see about updating eveything that refers to artist 2 to artist 3
$artist = $schema->resultset("Artist")->find(2);
my $nartist = $schema->resultset("Artist")->find(3);
cmp_ok($artist->cds->count, '==', 1, "Correct orig #cds for artist");
@@ -307,14 +307,14 @@ cmp_ok($nartist->cds->count, '==', 2, "Correct new #cds for artist");
# check if is_foreign_key_constraint attr is set
my $rs_normal = $schema->source('Track');
my $relinfo = $rs_normal->relationship_info ('cd');
-cmp_ok($relinfo->{attrs}{is_foreign_key_constraint}, '==', 1, "is_foreign_key_constraint defined for belongs_to relationships.");
+cmp_ok($relinfo->{attrs}{is_foreign_key_constraint}, '==', 1, "is_foreign_key_constraint defined for refers_to relationships.");
my $rs_overridden = $schema->source('ForceForeign');
my $relinfo_with_attr = $rs_overridden->relationship_info ('cd_3');
-cmp_ok($relinfo_with_attr->{attrs}{is_foreign_key_constraint}, '==', 0, "is_foreign_key_constraint defined for belongs_to relationships with attr.");
+cmp_ok($relinfo_with_attr->{attrs}{is_foreign_key_constraint}, '==', 0, "is_foreign_key_constraint defined for refers_to relationships with attr.");
# check that relationships below left join relationships are forced to left joins
-# when traversing multiple belongs_to
+# when traversing multiple refers_to
my $cds = $schema->resultset("CD")->search({ 'me.cdid' => 5 }, { join => { single_track => 'cd' } });
is($cds->count, 1, "subjoins under left joins force_left (string)");
View
6 t/relationship/custom.t
@@ -225,10 +225,10 @@ foreach (@artwork_artists) {
lives_ok {
my $artista = $_->artist;
my $artistb = $_->artist_test_m2m;
- ok($artista->rank < 10 ? $artistb : 1, 'belongs_to with custom rel works.');
+ ok($artista->rank < 10 ? $artistb : 1, 'refers_to with custom rel works.');
my $artistc = $_->artist_test_m2m_noopt;
- ok($artista->rank < 10 ? $artistc : 1, 'belongs_to with custom rel works even in non-simplified.');
- } 'belongs_to works with custom rels';
+ ok($artista->rank < 10 ? $artistc : 1, 'refers_to with custom rel works even in non-simplified.');
+ } 'refers_to works with custom rels';
}
@artists = ();
View
12 t/relationship/info.t
@@ -17,7 +17,7 @@ use DBICTest;
__PACKAGE__->add_columns(qw/id ancestor_id/);
__PACKAGE__->set_primary_key('id');
__PACKAGE__->has_many(children => __PACKAGE__, 'id');
- __PACKAGE__->belongs_to(parent => __PACKAGE__, 'id', { join_type => 'left' } );
+ __PACKAGE__->refers_to(parent => __PACKAGE__, 'id', { join_type => 'left' } );
__PACKAGE__->has_many(subthings => 'DBICTest::SubThing', 'thing_id');
}
@@ -29,8 +29,8 @@ use DBICTest;
use base qw/DBIx::Class::Core/;
__PACKAGE__->table('subthing');
__PACKAGE__->add_columns(qw/thing_id/);
- __PACKAGE__->belongs_to(thing => 'DBICTest::Thing', 'thing_id');
- __PACKAGE__->belongs_to(thing2 => 'DBICTest::Thing', 'thing_id', { join_type => 'left' } );
+ __PACKAGE__->refers_to(thing => 'DBICTest::Thing', 'thing_id');
+ __PACKAGE__->refers_to(thing2 => 'DBICTest::Thing', 'thing_id', { join_type => 'left' } );
}
my $schema = DBICTest->init_schema;
@@ -62,12 +62,12 @@ for my $without_schema (1,0) {
is_deeply(
_instance($s)->reverse_relationship_info('thing'),
{ subthings => $t->relationship_info('subthings') },
- 'reverse_rel_info works cross-class belongs_to direction',
+ 'reverse_rel_info works cross-class refers_to direction',
);
is_deeply(
_instance($s)->reverse_relationship_info('thing2'),
{ subthings => $t->relationship_info('subthings') },
- 'reverse_rel_info works cross-class belongs_to direction 2',
+ 'reverse_rel_info works cross-class refers_to direction 2',
);
is_deeply(
@@ -79,7 +79,7 @@ for my $without_schema (1,0) {
is_deeply(
_instance($t)->reverse_relationship_info('parent'),
{ children => $t->relationship_info('children') },
- 'reverse_rel_info works in-class belongs_to direction',
+ 'reverse_rel_info works in-class refers_to direction',
);
is_deeply(
_instance($t)->reverse_relationship_info('children'),
View
14 t/relationship/set_column_on_fk.t
@@ -24,24 +24,24 @@ my $new_link = $schema->resultset("Link")->create({
is( $bookmark->link->id, 1, 'Initial relation id' );
$bookmark->set_column( 'link', 9 );
-is( $bookmark->link->id, 9, 'Correct object re-selected after belongs_to set' );
+is( $bookmark->link->id, 9, 'Correct object re-selected after refers_to set' );
$bookmark->discard_changes;
-is( $bookmark->link->id, 1, 'Pulled the correct old object after belongs_to reset' );
+is( $bookmark->link->id, 1, 'Pulled the correct old object after refers_to reset' );
$bookmark->link($new_link);
is( $bookmark->get_column('link'), 9, 'Correct column set from related' );
$bookmark->discard_changes;
-is( $bookmark->link->id, 1, 'Pulled the correct old object after belongs_to reset' );
+is( $bookmark->link->id, 1, 'Pulled the correct old object after refers_to reset' );
$bookmark->link(9);
is( $bookmark->link->id, 9, 'Correct object selected on deflated accessor set');
$bookmark->discard_changes;
-is( $bookmark->link->id, 1, 'Pulled the correct old object after belongs_to reset' );
+is( $bookmark->link->id, 1, 'Pulled the correct old object after refers_to reset' );
$bookmark->update({ link => 9 });
@@ -55,16 +55,16 @@ is( $lyric->track->id, 5, 'Initial relation id');
$lyric->track_id(6);
my $track6 = $lyric->track;
-is( $track6->trackid, 6, 'Correct object re-selected after belongs_to set');
+is( $track6->trackid, 6, 'Correct object re-selected after refers_to set');
$lyric->discard_changes;
-is( $lyric->track->trackid, 5, 'Pulled the correct old rel object after belongs_to reset');
+is( $lyric->track->trackid, 5, 'Pulled the correct old rel object after refers_to reset');
$lyric->track($track6);
is( $lyric->track_id, 6, 'Correct column set from related');
$lyric->discard_changes;
-is( $lyric->track->trackid, 5, 'Pulled the correct old rel object after belongs_to reset');
+is( $lyric->track->trackid, 5, 'Pulled the correct old rel object after refers_to reset');
$lyric->update({ track => $track6 });
is( $lyric->track->trackid, 6, 'Correct relationship obj after update' );
Please sign in to comment.
Something went wrong with that request. Please try again.