naming
datetime_timezone
datetime_locale
+ config_file
/);
Sets the locale attribute for L<DBIx::Class::InflateColumn::DateTime> for all
columns with the DATE/DATETIME/TIMESTAMP data_types.
+=head1 config_file
+
+File in Perl format, which should return a HASH reference, from which to read
+loader options.
+
=head1 METHODS
None of these methods are intended for direct invocation by regular
bless $self => $class;
+ if (my $config_file = $self->config_file) {
+ my $config_opts = do $config_file;
+
+ croak "Error reading config from $config_file: $@" if $@;
+
+ croak "Config file $config_file must be a hashref" unless ref($config_opts) eq 'HASH';
+
+ while (my ($k, $v) = each %$config_opts) {
+ $self->{$k} = $v unless exists $self->{$k};
+ }
+ }
+
$self->_ensure_arrayref(qw/additional_classes
additional_base_classes
left_base_classes
);
DBICTest::Schema::12->clone;
},
- 'skip_load_external_1' => sub {
+ 'no_skip_load_external' => sub {
# By default we should pull in t/lib/DBICTest/Schema/13/Foo.pm $skip_me since t/lib is in @INC
use DBIx::Class::Schema::Loader;
DBIx::Class::Schema::Loader::make_schema_at(
);
DBICTest::Schema::13->clone;
},
- 'skip_load_external_2' => sub {
+ 'skip_load_external' => sub {
# When we explicitly skip_load_external t/lib/DBICTest/Schema/14/Foo.pm should be ignored
use DBIx::Class::Schema::Loader;
DBIx::Class::Schema::Loader::make_schema_at(
use strict;
use Test::More;
-use lib qw(t/lib);
use File::Path;
use IPC::Open3;
-use make_dbictest_db;
use Data::Dumper::Concise;
-require DBIx::Class::Schema::Loader;
+use DBIx::Class::Schema::Loader ();
+use File::Temp 'tempfile';
+use lib qw(t/lib);
+use make_dbictest_db;
my $DUMP_PATH = './t/_dump';
rmtree($DUMP_PATH, 1, 1);
+# test config_file
+
+my ($fh, $config_file) = tempfile;
+
+print $fh <<'EOF';
+{ skip_relationships => 1 }
+EOF
+close $fh;
+
+do_dump_test(
+ classname => 'DBICTest::Schema::14',
+ options => { config_file => $config_file },
+ error => '',
+ warnings => [
+ qr/Dumping manual schema for DBICTest::Schema::14 to directory /,
+ qr/Schema dump completed/,
+ ],
+ neg_regexes => {
+ Foo => [
+ qr/has_many/,
+ ],
+ },
+);
+
+unlink $config_file;
+
# test out the POD
do_dump_test(