preload 0.1.2 → 0.2.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.
data/lib/preload.rb CHANGED
@@ -3,3 +3,10 @@ require 'preload/version'
3
3
  require 'preload/array_mixin'
4
4
 
5
5
  Array.send(:include, Preload::ArrayMixin)
6
+
7
+ begin
8
+ require 'will_paginate'
9
+ require 'will_paginate/collection'
10
+ WillPaginate::Collection.send(:include, Preload::ArrayMixin)
11
+ rescue LoadError => e
12
+ end
@@ -7,7 +7,7 @@ module Preload
7
7
 
8
8
  if defined?(ActiveRecord::Associations::Preloader)
9
9
  ActiveRecord::Associations::Preloader.new(self, associations).run
10
- elsif ActiveRecord::Base.respond_to?(:preload_associations)
10
+ elsif ActiveRecord::Base.respond_to?(:preload_associations, true)
11
11
  first.class.send(:preload_associations, self, associations)
12
12
  else
13
13
  raise "Unsupported version of ActiveRecord"
@@ -1,3 +1,3 @@
1
1
  module Preload
2
- VERSION = "0.1.2"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: preload
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
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: 2012-08-09 00:00:00.000000000 Z
12
+ date: 2013-06-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -113,6 +113,22 @@ dependencies:
113
113
  - - ! '>='
114
114
  - !ruby/object:Gem::Version
115
115
  version: '0'
116
+ - !ruby/object:Gem::Dependency
117
+ name: will_paginate
118
+ requirement: !ruby/object:Gem::Requirement
119
+ none: false
120
+ requirements:
121
+ - - ! '>='
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - ! '>='
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
116
132
  description: A better API for ActiveRecord eager loading
117
133
  email:
118
134
  - mick@staugaard.com
@@ -124,7 +140,8 @@ files:
124
140
  - lib/preload/version.rb
125
141
  - lib/preload.rb
126
142
  homepage: https://github.com/staugaard/preload
127
- licenses: []
143
+ licenses:
144
+ - MIT
128
145
  post_install_message:
129
146
  rdoc_options: []
130
147
  require_paths:
@@ -137,7 +154,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
137
154
  version: '0'
138
155
  segments:
139
156
  - 0
140
- hash: -1826733769130315462
157
+ hash: 3808257276543450009
141
158
  required_rubygems_version: !ruby/object:Gem::Requirement
142
159
  none: false
143
160
  requirements:
@@ -146,10 +163,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
146
163
  version: '0'
147
164
  segments:
148
165
  - 0
149
- hash: -1826733769130315462
166
+ hash: 3808257276543450009
150
167
  requirements: []
151
168
  rubyforge_project:
152
- rubygems_version: 1.8.24
169
+ rubygems_version: 1.8.25
153
170
  signing_key:
154
171
  specification_version: 3
155
172
  summary: A better API for ActiveRecord eager loading