query_helper 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/query_helper.rb +10 -2
- data/lib/query_helper/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: 57e18fef49ee5e918c533ad632c3f01a6a6748a751675dc4d917e898072ab391
|
4
|
+
data.tar.gz: 6125eac1ac5f019ff7e686a19abe78824fe96f3cec110f02abc8f727d847cc18
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a945428a4dcc38487353461705dd52e9ef5e46acf7f81b5d3a871a3161d588ed36022cf5c313d6451ba837c25b0ea47cc7f90ccee57512034d8cae89da8bdb3
|
7
|
+
data.tar.gz: 94ffe7976b315a38557ea21ab9faa52e8ad24a61a9f30d2c52520f63c9bd6b1385a7d756a3bc801e9fd8328a136703151ea3868fa4afe995ca51ac5a50ac078d
|
data/Gemfile.lock
CHANGED
data/lib/query_helper.rb
CHANGED
@@ -109,11 +109,19 @@ class QueryHelper
|
|
109
109
|
manipulator.build()
|
110
110
|
end
|
111
111
|
|
112
|
-
def
|
112
|
+
def to_json(args)
|
113
|
+
results.to_json
|
114
|
+
end
|
115
|
+
|
116
|
+
def to_sql
|
113
117
|
query = build_query()
|
114
118
|
@model.sanitize_sql_array([query, @bind_variables])
|
115
119
|
end
|
116
120
|
|
121
|
+
def view_query
|
122
|
+
to_sql
|
123
|
+
end
|
124
|
+
|
117
125
|
def execute_query
|
118
126
|
query = build_query()
|
119
127
|
@results = @model.find_by_sql([query, @bind_variables]) # Execute Sql Query
|
@@ -125,7 +133,7 @@ class QueryHelper
|
|
125
133
|
clean_results()
|
126
134
|
end
|
127
135
|
|
128
|
-
def results
|
136
|
+
def results
|
129
137
|
execute_query()
|
130
138
|
return paginated_results() if @api_payload
|
131
139
|
return @results
|
data/lib/query_helper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: query_helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evan McDaniel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-11-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|