Skip to content

Commit

Permalink
Rename MetaCPAN::Role Script and code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
Talina06 committed Aug 20, 2014
1 parent 25ef822 commit 845c2ab
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions lib/MetaCPAN/Document/Stargazer.pm
Expand Up @@ -5,13 +5,13 @@ use warnings;

use Moose;
use ElasticSearchX::Model::Document;

use DateTime;
use MetaCPAN::Types qw(:all);

has id => (
is => 'ro',
id => [qw(user module)],
is => 'ro',
id => [qw(user module)],
isa => 'NonEmptySimpleStr',
);

has [qw(author release user module)] => (
Expand Down
3 changes: 1 addition & 2 deletions lib/MetaCPAN/Server/Controller/Stargazer.pm
Expand Up @@ -13,7 +13,6 @@ with 'MetaCPAN::Server::Role::JSONP';
sub find : Path('') : Args(2) {
my ( $self, $c, $user, $module ) = @_;
try {

my $stargazer = $self->model($c)->raw->get(
{
user => $user,
Expand All @@ -23,7 +22,7 @@ sub find : Path('') : Args(2) {
$c->stash( $stargazer->{_source} || $stargazer->{fields} );
}
catch {
$c->detach( '/not_found', [$@] );
$c->detach( '/not_found', [$_] );
};
}

Expand Down
2 changes: 1 addition & 1 deletion lib/MetaCPAN/Server/Controller/User/Stargazer.pm
Expand Up @@ -7,7 +7,7 @@ use Moose;

BEGIN { extends 'Catalyst::Controller::REST' }

with 'MetaCPAN::Server::Role::MapStarring';
with 'MetaCPAN::Server::Role::Starring';

sub auto : Private {
my ( $self, $c ) = @_;
Expand Down
@@ -1,4 +1,4 @@
package MetaCPAN::Server::Role::MapStarring;
package MetaCPAN::Server::Role::Starring;

use strict;
use warnings;
Expand All @@ -10,11 +10,10 @@ sub index_POST {
my $req = $c->req;
my $star = $c->model('CPAN::Stargazer')->put(
{
user => $c->user->id,
author => $req->data->{author},
release => $req->data->{release},
module => $req->data->{module},
author => $req->data->{author},
release => $req->data->{release},
user => $c->user->id,
},
{ refresh => 1 }
);
Expand Down

0 comments on commit 845c2ab

Please sign in to comment.