From: simbabque Date: Sun, 11 Jun 2017 16:41:35 +0000 (+0200) Subject: document the `excludes` option for dump X-Git-Tag: v1.001038~3^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class-Fixtures.git;a=commitdiff_plain;h=861877be61c38fee58b181922bc49e8e29d94189 document the `excludes` option for dump --- diff --git a/lib/DBIx/Class/Fixtures.pm b/lib/DBIx/Class/Fixtures.pm index 9e1767b..7a2c4af 100644 --- a/lib/DBIx/Class/Fixtures.pm +++ b/lib/DBIx/Class/Fixtures.pm @@ -557,7 +557,8 @@ or $fixtures->dump({ all => 1, # just dump everything that's in the schema schema => $source_dbic_schema, - directory => '/home/me/app/fixtures' # output directory + directory => '/home/me/app/fixtures', # output directory + #excludes => [ qw/Foo MyView/ ], # optionally exclude certain sources }); In this case objects will be dumped to subdirectories in the specified @@ -567,9 +568,14 @@ directory. For example: /home/me/app/fixtures/artist/3.fix /home/me/app/fixtures/producer/5.fix -schema and directory are required attributes. also, one of config or all must +C and C are required attributes. also, one of C or C must be specified. +The optional parameter C takes an array ref of source names and can be +used to exclue those sources when dumping the whole schema. This is useful if +you have views in there, since those do not need fixtures and will currently result +in an error when they are created and then used with C. + Lastly, the C parameter can be a Perl HashRef instead of a file name. If this form is used your HashRef should conform to the structure rules defined for the JSON representations. @@ -1591,4 +1597,4 @@ sub _name_for_source { =cut -1; +1; \ No newline at end of file