10 my $schema = DBICTest->init_schema();
12 my $mo_rs = $schema->resultset('Artist')->search(
13 { 'me.artistid' => 4 },
18 { tracks => { cd_single => 'tracks' } },
19 { cd_to_producer => 'producer' }
22 { artwork_to_artist => 'artwork' }
25 result_class => 'DBIx::Class::ResultClass::HashRefInflator',
27 order_by => [qw/tracks.position tracks.trackid producer.producerid/],
31 $schema->resultset('Artist')->create(
37 title => 'Song of a Foo',
41 title => 'Foo Me Baby One More Time',
44 title => 'Foo Me Baby One More Time II',
47 title => 'Foo Me Baby One More Time III',
50 title => 'Foo Me Baby One More Time IV',
52 { artist => 1, title => 'MO! Single', year => 2021, tracks => [
53 { title => 'singled out' }, { title => 'still alone' },
58 { producer => { name => 'riba' } },
59 { producer => { name => 'sushi' } },
63 title => 'Song of a Foo II',
67 title => 'Quit Playing Games With My Heart',
75 { artist => 2, title => 'MO! Single', year => 2020, tracks => [
76 { title => 'singled out' }, { title => 'still alone' },
81 { producer => { name => 'riba' } },
82 { producer => { name => 'sushi' } },
87 [ { artwork => { cd_id => 1 } }, { artwork => { cd_id => 2 } } ]
91 my $mo = $mo_rs->next;
93 is( @{$mo->{cds}}, 2, 'two CDs' );
100 'single_track' => undef,
106 'title' => 'Foo Me Baby One More Time',
107 'cd_single' => undef,
108 'last_updated_on' => undef,
109 'last_updated_at' => undef
115 'title' => 'Foo Me Baby One More Time II',
116 'cd_single' => undef,
117 'last_updated_on' => undef,
118 'last_updated_at' => undef
124 'title' => 'Foo Me Baby One More Time III',
125 'cd_single' => undef,
126 'last_updated_on' => undef,
127 'last_updated_at' => undef
133 'title' => 'Foo Me Baby One More Time IV',
134 'last_updated_on' => undef,
135 'last_updated_at' => undef,
137 'single_track' => '22',
140 'title' => 'MO! Single',
147 'title' => 'singled out',
149 'last_updated_at' => undef,
150 'last_updated_on' => undef
155 'title' => 'still alone',
157 'last_updated_at' => undef,
158 'last_updated_on' => undef
166 'cd_to_producer' => [
168 'attribute' => undef,
176 'attribute' => undef,
184 'title' => 'Song of a Foo',
189 'single_track' => undef,
195 'title' => 'Quit Playing Games With My Heart',
196 'last_updated_on' => undef,
197 'last_updated_at' => undef,
198 'cd_single' => undef,
204 'title' => 'Bar Foo',
205 'cd_single' => undef,
206 'last_updated_on' => undef,
207 'last_updated_at' => undef
213 'title' => 'Foo Bar',
214 'last_updated_on' => undef,
215 'last_updated_at' => undef,
217 'single_track' => '27',
220 'title' => 'MO! Single',
227 'title' => 'singled out',
229 'last_updated_at' => undef,
230 'last_updated_on' => undef
235 'title' => 'still alone',
237 'last_updated_at' => undef,
238 'last_updated_on' => undef
247 'cd_to_producer' => [
249 'attribute' => undef,
257 'attribute' => undef,
265 'title' => 'Song of a Foo II',
271 'charfield' => undef,
273 'artwork_to_artist' => [
275 'artwork' => { 'cd_id' => '1' },
277 'artwork_cd_id' => '1'
280 'artwork' => { 'cd_id' => '2' },
282 'artwork_cd_id' => '2'