9 my $schema = DBICTest->init_schema();
11 my $mo_rs = $schema->resultset('Artist')->search(
12 { 'me.artistid' => 4 },
17 { tracks => { cd_single => 'tracks' } },
18 { cd_to_producer => 'producer' }
21 { artwork_to_artist => 'artwork' }
24 result_class => 'DBIx::Class::ResultClass::HashRefInflator',
26 order_by => [qw/tracks.position tracks.trackid producer.producerid/],
30 $schema->resultset('Artist')->create(
36 title => 'Song of a Foo',
40 title => 'Foo Me Baby One More Time',
43 title => 'Foo Me Baby One More Time II',
46 title => 'Foo Me Baby One More Time III',
49 title => 'Foo Me Baby One More Time IV',
51 { artist => 1, title => 'MO! Single', year => 2021, tracks => [
52 { title => 'singled out' }, { title => 'still alone' },
57 { producer => { name => 'riba' } },
58 { producer => { name => 'sushi' } },
62 title => 'Song of a Foo II',
66 title => 'Quit Playing Games With My Heart',
74 { artist => 2, title => 'MO! Single', year => 2020, tracks => [
75 { title => 'singled out' }, { title => 'still alone' },
80 { producer => { name => 'riba' } },
81 { producer => { name => 'sushi' } },
86 [ { artwork => { cd_id => 1 } }, { artwork => { cd_id => 2 } } ]
90 my $mo = $mo_rs->next;
92 is( @{$mo->{cds}}, 2, 'two CDs' );
99 'single_track' => undef,
105 'title' => 'Foo Me Baby One More Time',
106 'cd_single' => undef,
107 'last_updated_on' => undef,
108 'last_updated_at' => undef
114 'title' => 'Foo Me Baby One More Time II',
115 'cd_single' => undef,
116 'last_updated_on' => undef,
117 'last_updated_at' => undef
123 'title' => 'Foo Me Baby One More Time III',
124 'cd_single' => undef,
125 'last_updated_on' => undef,
126 'last_updated_at' => undef
132 'title' => 'Foo Me Baby One More Time IV',
133 'last_updated_on' => undef,
134 'last_updated_at' => undef,
136 'single_track' => '22',
139 'title' => 'MO! Single',
146 'title' => 'singled out',
148 'last_updated_at' => undef,
149 'last_updated_on' => undef
154 'title' => 'still alone',
156 'last_updated_at' => undef,
157 'last_updated_on' => undef
165 'cd_to_producer' => [
167 'attribute' => undef,
175 'attribute' => undef,
183 'title' => 'Song of a Foo',
188 'single_track' => undef,
194 'title' => 'Quit Playing Games With My Heart',
195 'last_updated_on' => undef,
196 'last_updated_at' => undef,
197 'cd_single' => undef,
203 'title' => 'Bar Foo',
204 'cd_single' => undef,
205 'last_updated_on' => undef,
206 'last_updated_at' => undef
212 'title' => 'Foo Bar',
213 'last_updated_on' => undef,
214 'last_updated_at' => undef,
216 'single_track' => '27',
219 'title' => 'MO! Single',
226 'title' => 'singled out',
228 'last_updated_at' => undef,
229 'last_updated_on' => undef
234 'title' => 'still alone',
236 'last_updated_at' => undef,
237 'last_updated_on' => undef
246 'cd_to_producer' => [
248 'attribute' => undef,
256 'attribute' => undef,
264 'title' => 'Song of a Foo II',
270 'charfield' => undef,
272 'artwork_to_artist' => [
274 'artwork' => { 'cd_id' => '1' },
276 'artwork_cd_id' => '1'
279 'artwork' => { 'cd_id' => '2' },
281 'artwork_cd_id' => '2'