Merge branch 'Release-v0.9.2'

This commit is contained in:
Tom Bloor 2017-09-15 13:14:22 +01:00
commit 8f28c5ea02
4 changed files with 20 additions and 10 deletions

View file

@ -2,6 +2,11 @@
# Next Release # Next Release
# v0.9.2
* **Fix:** Leaderboard total calculations not mapped correctly
* **Fix:** Reroute to org list on submission
# v0.9.1 # v0.9.1
* Change to semantic versioning * Change to semantic versioning

View file

@ -115,7 +115,7 @@ sub valid_edit {
$c->flash( success => 'Updated Organisation' ); $c->flash( success => 'Updated Organisation' );
} }
}; };
$c->redirect_to( '/admin/organisations/' . $valid_org->id ); $c->redirect_to( '/admin/organisations/');
} }
1; 1;

View file

@ -92,7 +92,12 @@ sub post_leaderboards {
my @leaderboard_array = $today_values->all; my @leaderboard_array = $today_values->all;
if ( $validation->param('type') =~ /total$/ ) { if ( $validation->param('type') =~ /total$/ ) {
map { $_->{value} / 100000 } @leaderboard_array; @leaderboard_array = (map {
{
%$_,
value => $_->{value} / 100000,
}
} @leaderboard_array);
} }
my $current_user_position = $today_values->find({ entity_id => $c->stash->{api_user}->entity->id }); my $current_user_position = $today_values->find({ entity_id => $c->stash->{api_user}->entity->id });

View file

@ -80,13 +80,13 @@ my $now = DateTime->today();
$user_result->create_related( 'purchases', { $user_result->create_related( 'purchases', {
seller_id => $org_result->id, seller_id => $org_result->id,
value => 1, value => 100000,
proof_image => 'a', proof_image => 'a',
}); });
$user_result->create_related( 'purchases', { $user_result->create_related( 'purchases', {
seller_id => $org_result->id, seller_id => $org_result->id,
value => 9, value => 900000,
proof_image => 'a', proof_image => 'a',
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )), purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
}); });
@ -97,13 +97,13 @@ my $now = DateTime->today();
$user_result->create_related( 'purchases', { $user_result->create_related( 'purchases', {
seller_id => $org_result->id, seller_id => $org_result->id,
value => 3, value => 300000,
proof_image => 'a', proof_image => 'a',
}); });
$user_result->create_related( 'purchases', { $user_result->create_related( 'purchases', {
seller_id => $org_result->id, seller_id => $org_result->id,
value => 1, value => 100000,
proof_image => 'a', proof_image => 'a',
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )), purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
}); });
@ -114,13 +114,13 @@ my $now = DateTime->today();
$user_result->create_related( 'purchases', { $user_result->create_related( 'purchases', {
seller_id => $org_result->id, seller_id => $org_result->id,
value => 5, value => 500000,
proof_image => 'a', proof_image => 'a',
}); });
$user_result->create_related( 'purchases', { $user_result->create_related( 'purchases', {
seller_id => $org_result->id, seller_id => $org_result->id,
value => 5, value => 500000,
proof_image => 'a', proof_image => 'a',
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )), purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
}); });
@ -131,13 +131,13 @@ my $now = DateTime->today();
$user_result->create_related( 'purchases', { $user_result->create_related( 'purchases', {
seller_id => $org_result->id, seller_id => $org_result->id,
value => 9, value => 900000,
proof_image => 'a', proof_image => 'a',
}); });
$user_result->create_related( 'purchases', { $user_result->create_related( 'purchases', {
seller_id => $org_result->id, seller_id => $org_result->id,
value => 3, value => 300000,
proof_image => 'a', proof_image => 'a',
purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )), purchase_time => $dtf->format_datetime($now->clone->subtract( days => 1 )),
}); });