Skip to content

Instantly share code, notes, and snippets.

@tokuhirom
Created April 22, 2014 10:01
Show Gist options
  • Save tokuhirom/11172693 to your computer and use it in GitHub Desktop.
Save tokuhirom/11172693 to your computer and use it in GitHub Desktop.
sub Member::get_ad($self, $id) {
my $ad = $self->db->find->ad($id) or throw NotFoundException->throw;
if ($ad->member_id eq $self->id) {
return $ad;
} else {
return SecurityException->throw(); # ここはもう
}
}
sub Controller::dispatch_update_ad($c) {
my $ad = $c->member->get_ad($id);
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment