predictive_load 0.3.0 → 0.3.1
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 +4 -4
- data/lib/predictive_load.rb +10 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 06c683b9447d34decb31d5c7364b83e05896a0d5
|
|
4
|
+
data.tar.gz: 60aabeabaf9889446277fabfb26b581a9a5bba3f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 59b7d697564804716960c66ead83b077c7c07acb3d26b9afa42e6c886a6a13b94e166fc872136625bf3dec869945eff01a9fdec922f52a667294331723cb441b
|
|
7
|
+
data.tar.gz: 88d0b749741eca4d134ba75d1797f0c1985de83634c0385ea6558bf9a0528610e845614bedef753edb54a53028aebf68cf6ab15fa7c653698a86630dfbf2735e
|
data/lib/predictive_load.rb
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
module PredictiveLoad
|
|
2
2
|
end
|
|
3
3
|
|
|
4
|
-
ActiveRecord::Associations::Builder::Association
|
|
4
|
+
klasses = [ActiveRecord::Associations::Builder::Association]
|
|
5
|
+
|
|
6
|
+
if ActiveRecord::VERSION::MAJOR == 3
|
|
7
|
+
# when belongs_to etc is loaded before us it already made a copy of valid_options
|
|
8
|
+
klasses.concat ActiveRecord::Associations::Builder::Association.descendants
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
klasses.each do |klass|
|
|
12
|
+
klass.valid_options << :predictive_load
|
|
13
|
+
end
|