logical_query_parser 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/logical_query_parser.rb +3 -3
- data/lib/logical_query_parser/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f5f35cb942ce106b76c221515c541fe5000984951951027aed0c65bbaaeda661
|
4
|
+
data.tar.gz: 106c7a62724f8133aec5ee701c36944fffb3d7f7dd5cdf56a0513d880b347c58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d1009c089fe2d3ff11c825980a60a6268fbddde922539b11cbe16b65072b538d549976a5ef143a2a38ebdd8f1d24fec5fdd480787dd3768f1a1b1a5e3c7496b
|
7
|
+
data.tar.gz: 9bd7e88f599ed9ae61f145de30f6d699b9a0428a80c8e81b60c3ce192d00c606485a5b0f49bda7642beddec5ad01b412fe04fc6bfb5a12bb43d9aeb3f1a572e9
|
data/CHANGELOG.md
CHANGED
data/lib/logical_query_parser.rb
CHANGED
@@ -14,13 +14,13 @@ module LogicalQueryParser
|
|
14
14
|
|
15
15
|
def search(query, relations, *options)
|
16
16
|
relations = relations.all if relations.respond_to?(:all)
|
17
|
-
assoc = resolve_assocs(relations.klass, options)
|
17
|
+
assoc = resolve_assocs(relations.klass, *options)
|
18
18
|
sql = new.parse(query).to_sql(model: relations.klass, columns: assoc.column_mapping)
|
19
19
|
relations.joins(assoc.structure).where(sql)
|
20
20
|
end
|
21
21
|
|
22
|
-
def resolve_assocs(klass, options)
|
23
|
-
AssocResolver.new(klass).run(options)
|
22
|
+
def resolve_assocs(klass, *options)
|
23
|
+
AssocResolver.new(klass).run(*options)
|
24
24
|
end
|
25
25
|
|
26
26
|
def walk_tree(node, &block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logical_query_parser
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoshikazu Kaneta
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-09-
|
11
|
+
date: 2019-09-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: treetop
|