X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FResultSource%2FView.pm;h=c053009a2f31fcf53d43e7ec86af600993e3c999;hb=bbe0a14d6df060f74123365d906fc16a4187d1ae;hp=3cf5cf864ff1df7c19a30a51df005831644d3419;hpb=41d90e353cfaa8bd9a87df53550b487d9f366c8d;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/ResultSource/View.pm b/lib/DBIx/Class/ResultSource/View.pm index 3cf5cf8..c053009 100644 --- a/lib/DBIx/Class/ResultSource/View.pm +++ b/lib/DBIx/Class/ResultSource/View.pm @@ -76,7 +76,7 @@ above, you can then: If you modified the schema to include a placeholder __PACKAGE__->result_source_instance->view_definition( - "SELECT cdid, artist, title FROM cd WHERE year ='?'" + "SELECT cdid, artist, title FROM cd WHERE year = ?" ); and ensuring you have is_virtual set to true: @@ -132,11 +132,11 @@ syntaxes. =head2 deploy_depends_on __PACKAGE__->result_source_instance->deploy_depends_on( - "MyDB::Schema::Result::Year","MyDB::Schema::Result::CD" + ["MyDB::Schema::Result::Year","MyDB::Schema::Result::CD"] ); Specify the views (and only the views) that this view depends on. -Pass this an array reference. +Pass this an array reference of fully qualified result classes. =head1 OVERRIDDEN METHODS @@ -153,15 +153,21 @@ sub from { return $self->name; } +=head1 OTHER METHODS + +=head2 new + +The constructor. + +=cut + sub new { my ( $self, @args ) = @_; my $new = $self->next::method(@args); - $new->{deploy_depends_on} - = { - map { $_->result_source_instance->name => 1 } - @{ $new->{deploy_depends_on}||[] } - } - unless ref $new->{deploy_depends_on} eq 'HASH'; + $new->{deploy_depends_on} = + { map { $_ => 1 } + @{ $new->{deploy_depends_on} || [] } } + unless ref $new->{deploy_depends_on} eq 'HASH'; return $new; } @@ -169,17 +175,7 @@ sub new { =head1 AUTHORS -Matt S. Trout - -With Contributions from: - -Guillermo Roditi Egroditi@cpan.orgE - -Jess Robinson - -Wallace Reis - -Amiri Barksdale +See L. =head1 LICENSE