[Bast-commits] r7328 - in DBIx-Class/0.08/branches/view-deps/lib:
DBIx/Class/ResultSource SQL/Translator/Parser/DBIx
matthewt at dev.catalyst.perl.org
matthewt at dev.catalyst.perl.org
Tue Aug 18 03:05:38 GMT 2009
Author: matthewt
Date: 2009-08-18 03:05:37 +0000 (Tue, 18 Aug 2009)
New Revision: 7328
Modified:
DBIx-Class/0.08/branches/view-deps/lib/DBIx/Class/ResultSource/View.pm
DBIx-Class/0.08/branches/view-deps/lib/SQL/Translator/Parser/DBIx/Class.pm
Log:
dependency for views
Modified: DBIx-Class/0.08/branches/view-deps/lib/DBIx/Class/ResultSource/View.pm
===================================================================
--- DBIx-Class/0.08/branches/view-deps/lib/DBIx/Class/ResultSource/View.pm 2009-08-18 02:02:29 UTC (rev 7327)
+++ DBIx-Class/0.08/branches/view-deps/lib/DBIx/Class/ResultSource/View.pm 2009-08-18 03:05:37 UTC (rev 7328)
@@ -8,9 +8,15 @@
use base qw/DBIx::Class/;
__PACKAGE__->load_components(qw/ResultSource/);
__PACKAGE__->mk_group_accessors(
- 'simple' => qw(is_virtual view_definition)
+ 'simple' => qw(is_virtual view_definition depends_on)
);
+sub new {
+ my $new = shift->next::method(@_);
+ $new->{depends_on} = { %{$new->{depends_on}||{}} };
+ return $new;
+}
+
=head1 NAME
DBIx::Class::ResultSource::View - ResultSource object representing a view
Modified: DBIx-Class/0.08/branches/view-deps/lib/SQL/Translator/Parser/DBIx/Class.pm
===================================================================
--- DBIx-Class/0.08/branches/view-deps/lib/SQL/Translator/Parser/DBIx/Class.pm 2009-08-18 02:02:29 UTC (rev 7327)
+++ DBIx-Class/0.08/branches/view-deps/lib/SQL/Translator/Parser/DBIx/Class.pm 2009-08-18 03:05:37 UTC (rev 7328)
@@ -274,9 +274,16 @@
}
my %views;
- foreach my $moniker (sort @view_monikers)
+ my @view_sources =
+ sort {
+ (exists $a->depends_on->{$b->source_name} ? 1 : 0)
+ <=>
+ (exists $b->depends_on->{$a->source_name} ? 1 : 0)
+ }
+ map { $dbicschema->source($_) } @view_monikers;
+
+ foreach my $source (@view_sources)
{
- my $source = $dbicschema->source($moniker);
my $view_name = $source->name;
# FIXME - this isn't the right way to do it, but sqlt does not
More information about the Bast-commits
mailing list