- return (
- $root,
- (
- $r->model_class
- && File::Spec->catdir( $root, $r->model_class->moniker )
- ),
- File::Spec->catdir( $root, "custom" ),
- File::Spec->catdir( $root, "factory" )
- );
+ if(ref($root) ne 'ARRAY') {
+ $root = [ $root ];
+ }
+ my @output = ();
+ my $i = 0;
+ foreach my $path (@$root) {
+ push(@output,
+ (
+ $r->model_class
+ && File::Spec->catdir( $path, $r->model_class->table )
+ )
+ );
+ push(@output, File::Spec->catdir( $path, "custom" )) unless ($i);
+ push(@output, $path);
+ push(@output, File::Spec->catdir( $path, "factory" )) unless ($i);
+ $i = 1;
+ }
+
+ return grep( $_, @output);