inquery 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,7 @@
1
1
  module Inquery
2
2
  class Query
3
3
  include Mixins::SchemaValidation
4
+ include Mixins::RawSqlUtils
4
5
 
5
6
  attr_reader :params
6
7
 
@@ -46,5 +47,11 @@ module Inquery
46
47
  def osparams
47
48
  @osparams ||= OpenStruct.new(params)
48
49
  end
50
+
51
+ # Provides a connection to the database. May be overridden if a different
52
+ # connection is desired. Defaults to `ActiveRecord::Base.connection`.
53
+ def connection
54
+ ActiveRecord::Base.connection
55
+ end
49
56
  end
50
57
  end
@@ -19,6 +19,11 @@ module Inquery
19
19
  super(params)
20
20
  end
21
21
 
22
+ # Override the connection method to (re-)use the connection of the relation
23
+ def connection
24
+ @relation.connection
25
+ end
26
+
22
27
  private
23
28
 
24
29
  def parse_init_args(*args)
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inquery
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sitrox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-17 00:00:00.000000000 Z
11
+ date: 2019-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '1.3'
19
+ version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '1.3'
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -175,6 +175,7 @@ files:
175
175
  - ".rubocop.yml"
176
176
  - ".travis.yml"
177
177
  - ".yardopts"
178
+ - CHANGELOG.md
178
179
  - Gemfile
179
180
  - LICENSE
180
181
  - README.md
@@ -187,6 +188,7 @@ files:
187
188
  - doc/Inquery/Exceptions/InvalidRelation.html
188
189
  - doc/Inquery/Exceptions/UnknownCallSignature.html
189
190
  - doc/Inquery/Mixins.html
191
+ - doc/Inquery/Mixins/RawSqlUtils.html
190
192
  - doc/Inquery/Mixins/RelationValidation.html
191
193
  - doc/Inquery/Mixins/RelationValidation/ClassMethods.html
192
194
  - doc/Inquery/Mixins/SchemaValidation.html
@@ -210,6 +212,7 @@ files:
210
212
  - inquery.gemspec
211
213
  - lib/inquery.rb
212
214
  - lib/inquery/exceptions.rb
215
+ - lib/inquery/mixins/raw_sql_utils.rb
213
216
  - lib/inquery/mixins/relation_validation.rb
214
217
  - lib/inquery/mixins/schema_validation.rb
215
218
  - lib/inquery/query.rb
@@ -244,8 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
247
  - !ruby/object:Gem::Version
245
248
  version: '0'
246
249
  requirements: []
247
- rubyforge_project:
248
- rubygems_version: 2.6.8
250
+ rubygems_version: 3.0.3
249
251
  signing_key:
250
252
  specification_version: 4
251
253
  summary: A skeleton that allows extracting queries into atomic, reusable classes.