Skip to content

Instantly share code, notes, and snippets.

@rbuels
Created October 2, 2009 15:50
Show Gist options
  • Select an option

  • Save rbuels/199840 to your computer and use it in GitHub Desktop.

Select an option

Save rbuels/199840 to your computer and use it in GitHub Desktop.
sub delete_synonym {
my $self=shift;
my $synonym=shift;
my $schema = $self->result_source->schema;
my @synonyms= $schema->resultset("Cv::Cvtermsynonym")->search(
{ cvterm_id => $self->get_column('cvterm_id'),
synonym => { 'ilike' , "$synonym" }
});
foreach (@synonyms) { $_->delete(); }
}
# goes to
sub delete_synonym {
my $self = shift;
my $synonym = shift;
$self->result_source
->schema
->resultset("Cv::Cvtermsynonym")
->search({ cvterm_id => $self->get_column('cvterm_id'),
synonym => { 'ilike' , $synonym }
})
->delete;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment