push
travis-ci
15 of 25 new or added lines in 9 files covered. (60.0%)
1 existing line in 1 file now uncovered.20601 of 29948 relevant lines covered (68.79%)
228.14 hits per line
1 |
module Queries |
× |
2 |
|
|
3 |
class Repository::Autocomplete < Queries::Query |
× |
4 |
|
|
5 |
# @return [String]
|
|
6 |
def where_sql |
× |
NEW
|
a = [ |
× |
NEW
|
named, |
× |
NEW
|
acronym |
× |
NEW
|
].compact |
× |
11 |
|
|
NEW
|
return a.first.or(a.second) if a.size == 2 |
× |
NEW
|
a |
× |
UNCOV
14
|
end
|
× |
15 |
|
|
16 |
# @return [Scope]
|
|
17 |
def all |
× |
18 |
::Repository.where(where_sql).order('name, char_length(name)').limit(40) |
× |
19 |
end
|
× |
20 |
|
|
21 |
# @return [Arel::Table]
|
|
22 |
def table |
× |
23 |
::Repository.arel_table
|
× |
24 |
end
|
× |
25 |
|
|
26 |
# @return [Arel::Nodes::Matches]
|
|
27 |
def acronym |
× |
NEW
|
table[:acronym].matches_any(terms) unless !terms.any? |
× |
29 |
end
|
× |
30 |
end
|
× |
31 |
end
|
× |