From: Rafael Kitover Date: Mon, 30 Nov 2009 14:06:50 +0000 (+0000) Subject: base results on Core, only load components if there are extra components X-Git-Tag: 0.04999_12~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2229729e143b17296e4d6d4cb156b16d49f6a7ef;p=dbsrgits%2FDBIx-Class-Schema-Loader.git base results on Core, only load components if there are extra components --- diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index 8d64358..cc0b849 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -130,7 +130,8 @@ Base class for your schema classes. Defaults to 'DBIx::Class::Schema'. =head2 result_base_class -Base class for your table classes (aka result classes). Defaults to 'DBIx::Class'. +Base class for your table classes (aka result classes). Defaults to +'DBIx::Class::Core'. =head2 additional_base_classes @@ -525,7 +526,7 @@ sub _dump_to_dir { $self->_write_classfile($schema_class, $schema_text); - my $result_base_class = $self->result_base_class || 'DBIx::Class'; + my $result_base_class = $self->result_base_class || 'DBIx::Class::Core'; foreach my $src_class (@classes) { my $src_text = @@ -700,7 +701,9 @@ sub _make_src_class { $self->_use ($table_class, @{$self->additional_classes}); $self->_inject($table_class, @{$self->left_base_classes}); - $self->_dbic_stmt($table_class, 'load_components', @{$self->components}, 'Core'); + if (my @components = @{ $self->components }) { + $self->_dbic_stmt($table_class, 'load_components', @components); + } $self->_dbic_stmt($table_class, 'load_resultset_components', @{$self->resultset_components}) if @{$self->resultset_components};