query_helper 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93112cb7974e069da9db1dbf08d4a0f3511076a6991195e669747567f2d2caa7
4
- data.tar.gz: a242199dcea3eaa67c50792cf0b76cbe9fc9826a81f231649c81120969923cc9
3
+ metadata.gz: 871736bd5aa9e012fb55ce1738a150782de390cefa9275c2d61e5d5bd89cdf84
4
+ data.tar.gz: 7c11403e23c7b6247a540c475dae7aa083ffb79cf4f1f0ec944a583f86f8eccd
5
5
  SHA512:
6
- metadata.gz: ab24ee9a256fbb9282e3adbe79db6436235000a7be0e1f166b570d6b413c412a9f3e2d5b285938630671db1efadd7e4ed9bf13e4aa84326fb28efb060b4d2df7
7
- data.tar.gz: c08788615159a1da5fb4a218095ca5b7497360dbf7a074522d9f5f46cdffcca96cb40b4b9ba27ce905112b909dae0de42e8682292af0f0840d807b32831456d0
6
+ metadata.gz: 2105e8fee2c52885ef26b333eebe43cf017e030a6ee9420fc573f044c2d619586a9bdcf8569856861ce4599a24607284d1d80823d664c47f8465378b86bceffb
7
+ data.tar.gz: 0e2a4dc0b3a310f81e1713a78d61707d8d02a82b6300d7676ee6ec442f8d89302e74cf3bb81a1e13857cdf65d6d5246a19fbc13d16308ca35c4e47aa13dfb771
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- query_helper (0.1.0)
4
+ query_helper (0.1.1)
5
5
  activerecord (~> 5.0)
6
6
  activesupport (~> 5.0)
7
7
 
data/lib/query_helper.rb CHANGED
@@ -131,7 +131,7 @@ class QueryHelper
131
131
  raise InvalidQueryError.new("a valid model must be included to run a custom SQL query") unless @model < ActiveRecord::Base
132
132
  # If an active record query is passed in, find the model and sql from the query
133
133
  elsif @query.class < ActiveRecord::Relation
134
- @model = @query.model
134
+ @model ||= @query.model
135
135
  @query = @query.to_sql
136
136
  else
137
137
  raise InvalidQueryError.new("unable to determine query type")
@@ -1,3 +1,3 @@
1
1
  class QueryHelper
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
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.0
4
+ version: 0.1.1
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-08-01 00:00:00.000000000 Z
11
+ date: 2019-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler