zeal 0.0.1 → 0.0.2
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.
- data/README.md +1 -1
- data/lib/zeal.rb +6 -2
- data/lib/zeal/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
data/lib/zeal.rb
CHANGED
@@ -6,12 +6,16 @@ module Zeal
|
|
6
6
|
class << self
|
7
7
|
if Rails.version.to_s =~ /^3/
|
8
8
|
def eager_load(collection, *args)
|
9
|
-
|
9
|
+
if collection.length > 0
|
10
|
+
ActiveRecord::Associations::Preloader.new(collection, args).run
|
11
|
+
end
|
10
12
|
collection
|
11
13
|
end
|
12
14
|
else
|
13
15
|
def eager_load(collection, *args)
|
14
|
-
|
16
|
+
if collection.length > 0
|
17
|
+
class_of_collection(collection).send(:preload_associations, collection, args)
|
18
|
+
end
|
15
19
|
collection
|
16
20
|
end
|
17
21
|
end
|
data/lib/zeal/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zeal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2011-11-
|
12
|
+
date: 2011-11-30 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Zeal allows you to eager-load associations on ActiveRecord objects that
|
15
15
|
have already been loaded from the database.
|