querier 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/querier.rb +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd47eff36c3f752f277ce56bcd18635ef34f9a79d7765fdd91b56ae20f06444d
|
4
|
+
data.tar.gz: 6f95ffd91d3e52181eeb33ddc2f0fd3a444035365542f774c7b9ad8c923962e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a861883fac193952c33733c58ed2701d7424ad22196618d199fdd7a469075d0689196baa2cea9d0c3e5ac212ba99a252aff9d2670cdc4a382da4d844839615f
|
7
|
+
data.tar.gz: 343f454ff2489dea937cc6906c262d214383efb2b63d774a1e0f240b113691d04805f3f0e9656e50d1b539e35933a550bfe3af35e303bcb7d2cbfce8cf706df0
|
data/lib/querier.rb
CHANGED
@@ -58,9 +58,9 @@ class Querier
|
|
58
58
|
dataset.map {|record| OpenStruct.new(record.symbolize_keys!)}
|
59
59
|
end
|
60
60
|
|
61
|
-
def get_param_value raw_query_param
|
61
|
+
def get_param_value raw_query_param, quotefy_param=true
|
62
62
|
# where's String#quote when we need it?
|
63
|
-
raw_query_param.class.eql?(String) ? "'#{raw_query_param.to_s}'" : raw_query_param.to_s
|
63
|
+
raw_query_param.class.eql?(String) && quotefy_param ? "'#{raw_query_param.to_s}'" : raw_query_param.to_s
|
64
64
|
end
|
65
65
|
|
66
66
|
def fill_query_params query_template:, query_params:
|
@@ -68,9 +68,9 @@ class Querier
|
|
68
68
|
|
69
69
|
query_params.each do |query_param|
|
70
70
|
query_param_name = query_param[PARAM_NAME_INDEX].to_s
|
71
|
-
query_param_value = get_param_value(query_param[PARAM_VALUE_INDEX])
|
72
71
|
|
73
|
-
query.gsub! /{\?#{query_param_name}}/,
|
72
|
+
query.gsub! /{\?#{query_param_name}}/, get_param_value(query_param[PARAM_VALUE_INDEX], true)
|
73
|
+
query.gsub! /{\?#{query_param_name}\/no_quote}/, get_param_value(query_param[PARAM_VALUE_INDEX], false)
|
74
74
|
end
|
75
75
|
|
76
76
|
query
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: querier
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gedean Dias
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Active Record queries with variable number of params
|
14
14
|
email: gedean.dias@gmail.com
|
@@ -38,7 +38,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
38
38
|
version: '0'
|
39
39
|
requirements: []
|
40
40
|
rubyforge_project:
|
41
|
-
rubygems_version: 2.7.
|
41
|
+
rubygems_version: 2.7.7
|
42
42
|
signing_key:
|
43
43
|
specification_version: 4
|
44
44
|
summary: Active Record Querier
|