Use SQL-standard quoting in Year2000CDs view
[dbsrgits/DBIx-Class.git] / t / lib / DBICTest / Schema / Year2000CDs.pm
CommitLineData
0d9fc72b 1package # hide from PAUSE
a648ec78 2 DBICTest::Schema::Year2000CDs;
3
4a233f30 4use warnings;
5use strict;
6
0d9fc72b 7use base qw/DBICTest::Schema::CD/;
a648ec78 8
030c27ad 9__PACKAGE__->table_class('DBIx::Class::ResultSource::View');
084a2c0a 10__PACKAGE__->table('year2000cds');
a648ec78 11
0d9fc72b 12# need to operate on the instance for things to work
13__PACKAGE__->result_source_instance->view_definition( sprintf (
795c37a3 14 'SELECT %s FROM cd WHERE year = \'2000\'',
0d9fc72b 15 join (', ', __PACKAGE__->columns),
16));
a648ec78 17
59d89269 18__PACKAGE__->belongs_to( artist => 'DBICTest::Schema::Artist' );
98fcc1c0 19__PACKAGE__->has_many( tracks => 'DBICTest::Schema::Track', 'cd' );
59d89269 20
a648ec78 211;