Fixed issue with undefined env var, and bad reverse counting of days
This commit is contained in:
parent
606d5bffc2
commit
392d7f3a7a
2 changed files with 7 additions and 3 deletions
|
@ -18,7 +18,7 @@ sub run {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $ENV{MOJO_MODE} eq 'production' || $self->app->mode eq 'production' ) {
|
if ( ( defined( $ENV{MOJO_MODE} ) && $ENV{MOJO_MODE} eq 'production' ) || $self->app->mode eq 'production' ) {
|
||||||
say "Will not run dev data fixtures in production!";
|
say "Will not run dev data fixtures in production!";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ sub run {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $ENV{MOJO_MODE} eq 'production' || $self->app->mode eq 'production' ) {
|
if ( ( defined( $ENV{MOJO_MODE} ) && $ENV{MOJO_MODE} eq 'production' ) || $self->app->mode eq 'production' ) {
|
||||||
say "Will not run dev data fixtures in production!";
|
say "Will not run dev data fixtures in production!";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -61,8 +61,12 @@ sub run {
|
||||||
$number = 1;
|
$number = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unless ( defined $count ) {
|
||||||
|
$count = 0;
|
||||||
|
}
|
||||||
|
|
||||||
for my $day_sub ( 0 .. $count ) {
|
for my $day_sub ( 0 .. $count ) {
|
||||||
$datetime->subtract( days => $day_sub );
|
$datetime->subtract( days => 1 );
|
||||||
for ( 1 .. $number ) {
|
for ( 1 .. $number ) {
|
||||||
for my $user_result ( $user_rs->all ) {
|
for my $user_result ( $user_rs->all ) {
|
||||||
$user_result->create_related( 'transactions', {
|
$user_result->create_related( 'transactions', {
|
||||||
|
|
Reference in a new issue