preload 0.3.0 → 1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 70716b4feeaefe4922a34a7b70f00df603546885
4
- data.tar.gz: ecedea17199b3fd97016f10bcecae81a1bdcea19
3
+ metadata.gz: e504bbca72f8ea1a5b5fda8a7fac865270a0b7ce
4
+ data.tar.gz: 68d37241c4275d9fc396a568f84b7e7ad6822921
5
5
  SHA512:
6
- metadata.gz: 73ef97d6dbf7e1d2b7c6a450265633a113f68d63dd1d503b39f6fddd0d0fd6ede83f07f1f0abd74ba4b24d216d15fec96bbb64ad9bf5abad630c86ce55456852
7
- data.tar.gz: b000f254cbb4f90e5d0f8c1cd7466cfe39e2e55430258d189968711f98e440ef7a0b444f8100effbb88f7b75158872834c4b0eaf1326b9c073d1b162ed00b387
6
+ metadata.gz: 1f549115cf2f793faa31937a95f539591a274a9fee0df00a81d96f27f1f7ef175048deb0994edbb1b1b9e98f2905c39ada6b0ac88278304667d18fb8e87d3ba3
7
+ data.tar.gz: 6d32623b9c57211ef41b19f026a549afccb7583d6067f4bb82981e413f95b5f7f7db3d287ddad01fc54f888b4bfd27761cbb04c46964e20dabfaa63ff20908ee
@@ -5,7 +5,9 @@ module Preload
5
5
  def preload(*associations)
6
6
  return if empty?
7
7
 
8
- if defined?(ActiveRecord::Associations::Preloader)
8
+ if ActiveRecord::VERSION::MAJOR > 4 || (ActiveRecord::VERSION::MAJOR == 4 && ActiveRecord::VERSION::MINOR > 0)
9
+ ActiveRecord::Associations::Preloader.new.preload(self, associations)
10
+ elsif defined?(ActiveRecord::Associations::Preloader)
9
11
  ActiveRecord::Associations::Preloader.new(self, associations).run
10
12
  elsif ActiveRecord::Base.respond_to?(:preload_associations, true)
11
13
  first.class.send(:preload_associations, self, associations)
@@ -1,3 +1,3 @@
1
1
  module Preload
2
- VERSION = "0.3.0"
2
+ VERSION = "1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: '1.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mick Staugaard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-15 00:00:00.000000000 Z
11
+ date: 2014-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.3.6
19
+ version: '3.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '5.0'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 2.3.6
29
+ version: '3.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '5.0'