Skip to content

Instantly share code, notes, and snippets.

@ichesnokov
Created March 9, 2015 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ichesnokov/1d4236f79c69fd14ebbe to your computer and use it in GitHub Desktop.
Save ichesnokov/1d4236f79c69fd14ebbe to your computer and use it in GitHub Desktop.
Subclassed resultset with overridden search_rs()
# Wrapper to exclude services with 'deleted' status from search
sub search_rs {
my $self = shift;
my $next_method = $self->next::can('search_rs');
my $status_alias = $self->current_source_alias . '.status';
return $self->$next_method(@_)
->$next_method({ $status_alias => { '!=' => 'deleted' } });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment