Merge pull request #19 from Pear-Trading/TBSliver/Search-Fixes
Fix issue with turning quote_names on with case insensitive search
This commit is contained in:
commit
e32363b41a
2 changed files with 5 additions and 2 deletions
|
@ -14,6 +14,7 @@ has schema => sub {
|
||||||
$c->app->config->{dsn},
|
$c->app->config->{dsn},
|
||||||
$c->app->config->{user},
|
$c->app->config->{user},
|
||||||
$c->app->config->{pass},
|
$c->app->config->{pass},
|
||||||
|
{ quote_names => 1 },
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -172,12 +172,14 @@ sub post_search {
|
||||||
|
|
||||||
my $search_name = $validation->param('search_name');
|
my $search_name = $validation->param('search_name');
|
||||||
|
|
||||||
|
my $search_stmt = [ 'LOWER("name") LIKE ?', '%' . lc $search_name . '%' ];
|
||||||
|
|
||||||
my $valid_orgs_rs = $c->schema->resultset('Organisation')->search(
|
my $valid_orgs_rs = $c->schema->resultset('Organisation')->search(
|
||||||
{ 'LOWER(name)' => { -like => '%' . lc $search_name . '%' } },
|
\$search_stmt,
|
||||||
);
|
);
|
||||||
|
|
||||||
my $pending_orgs_rs = $c->stash->{api_user}->pending_organisations->search(
|
my $pending_orgs_rs = $c->stash->{api_user}->pending_organisations->search(
|
||||||
{ 'LOWER(name)' => { -like => '%' . lc $search_name . '%' } },
|
\$search_stmt,
|
||||||
);
|
);
|
||||||
|
|
||||||
my @valid_orgs = (
|
my @valid_orgs = (
|
||||||
|
|
Reference in a new issue