dao-gateway-active_record 1.3.0 → 1.4.0

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
  SHA1:
3
- metadata.gz: 0542f4a18900131bda7ea91ab7507057bb548548
4
- data.tar.gz: b4bd3c11570dd0e468a9ef1b1680cc229f18f81e
3
+ metadata.gz: f25cfbe2e48082dfd1eb2320cc3ccf601354e86b
4
+ data.tar.gz: 28e6e6694abe405e24a9f993695ae7ebf165f331
5
5
  SHA512:
6
- metadata.gz: 43ef35676c6e666018a2711208f61cbe74317fc38d487c4e8c5a3f0c5286de0139eb55ca2570f7a4d646b999ffbffaa591f03ce3c5bacf4dddaded1925d48bb2
7
- data.tar.gz: 7e586390263960e13085204b60866bbaf20ec1b6fcccb9cfbe2ee2d9d7e15036d62b3bdf9dd83572fa9c572cc58ca98fbb9ba5840713e05a80d43214545f835b
6
+ metadata.gz: 24728ce83fad31f66667f9f61f7d6a8faccc8667bc5dc7d3f57e81e41bf483c656c06d255dff0625c8742f5242532a3bf2e45500fa7eb30b2acbc7c4f90a3d03
7
+ data.tar.gz: 4e67228135668feb54f6b9aa12ecc687dfacde2ee28910ddb03704ca168faeb472743a23104afea0fe5ad1b3de3c2d32848e0960df3f226365205e267c3ddd62
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
 
21
21
  spec.required_ruby_version = '>= 2.2.2'
22
22
 
23
- spec.add_dependency 'dao-gateway', '~> 1.3'
23
+ spec.add_dependency 'dao-gateway', '~> 1.4'
24
24
  spec.add_dependency 'activerecord', '>= 4.2'
25
25
  spec.add_dependency 'activesupport', '>= 4.2'
26
26
 
@@ -33,8 +33,15 @@ module Dao
33
33
  raise Dao::Gateway::RecordNotFound, e.message
34
34
  end
35
35
 
36
- def add_relations(scope, relations)
37
- scope.eager_load(*relations)
36
+ def add_relations(scope, relations, options)
37
+ case options[:strategy]
38
+ when :preload
39
+ scope.preload(*relations)
40
+ when :includes
41
+ scope.includes(*relations)
42
+ else
43
+ scope.eager_load(*relations)
44
+ end
38
45
  end
39
46
 
40
47
  def with_transaction(&block)
@@ -1,7 +1,7 @@
1
1
  module Dao
2
2
  module Gateway
3
3
  module ActiveRecord
4
- VERSION = '1.3.0'
4
+ VERSION = '1.4.0'
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dao-gateway-active_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - llxff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-08-06 00:00:00.000000000 Z
12
+ date: 2016-12-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: dao-gateway
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - "~>"
19
19
  - !ruby/object:Gem::Version
20
- version: '1.3'
20
+ version: '1.4'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - "~>"
26
26
  - !ruby/object:Gem::Version
27
- version: '1.3'
27
+ version: '1.4'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: activerecord
30
30
  requirement: !ruby/object:Gem::Requirement