Closed Dingying0410 closed 3 years ago
Merging #63 (ae61aca) into main (ee26d55) will increase coverage by
0.05%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## main #63 +/- ##
==========================================
+ Coverage 97.37% 97.42% +0.05%
==========================================
Files 34 34
Lines 2209 2252 +43
==========================================
+ Hits 2151 2194 +43
Misses 58 58
Impacted Files | Coverage Δ | |
---|---|---|
lib/redis_memo/memoize_query/cached_select.rb | 93.28% <100.00%> (-0.05%) |
:arrow_down: |
spec/memoize_query_spec.rb | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update ee26d55...ae61aca. Read the comment docs.
The build failure seems legit btw
Summary
This PR is to support the queries that have range in it. such as '>=', '<=', etc., and also combine the
NotEqual
query we had in #62 since they can all be merged into theNodeHasComparator
condition in this PR.Regarding the rspec, I created several shared examples so we can test multiple similar behaviors.
Details
Previously we decided to not to cache any queries with these comparison operators, however, queries with both comparison operators and other bound queries can be cached. E.g
Also, as according to here, there are two forms of queries with comparator:
Arel::Nodes::Grouping
when we parse the children of the wheres, thus, we look atnode.expr
of it.node.expr
is usually aArel::Nodes::SqlLiteral
in this caseArel::Nodes::LessThan
when we parse the children of the wheres, thus, we categorizeArel::Nodes::LessThan
and also other node class asNodeHasComparators
My current approach is to return
bind_params
when we parse these statementsTest plan
TODO:
remove the duplicate Arel::Nodes::NotEqual block in #62 since they are brought in this PR