will_paginate 2.2.0 → 2.2.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.
Potentially problematic release.
This version of will_paginate might be problematic. Click here for more details.
- data/CHANGELOG +11 -1
- data/Rakefile +27 -0
- data/lib/will_paginate/named_scope_patch.rb +6 -17
- data/lib/will_paginate/version.rb +1 -1
- data/lib/will_paginate/view_helpers.rb +1 -1
- metadata +2 -2
data/CHANGELOG
CHANGED
@@ -1,3 +1,12 @@
|
|
1
|
+
== 2.2.1, released 2008-04-08
|
2
|
+
|
3
|
+
* take less risky path when monkeypatching named_scope; fix that it no longer
|
4
|
+
requires ActiveRecord::VERSION
|
5
|
+
* use strings in "respond_to?" calls to work around a bug in acts_as_ferret
|
6
|
+
stable (ugh)
|
7
|
+
* add rake release task
|
8
|
+
|
9
|
+
|
1
10
|
== 2.2.0, released 2008-04-07
|
2
11
|
|
3
12
|
=== API changes
|
@@ -30,4 +39,5 @@
|
|
30
39
|
|
31
40
|
* Add "paginated_each" method for iterating through every record by loading only
|
32
41
|
one page of records at the time
|
33
|
-
* Rails 2: Rescue from WillPaginate::InvalidPage error with 404 Not Found by
|
42
|
+
* Rails 2: Rescue from WillPaginate::InvalidPage error with 404 Not Found by
|
43
|
+
default
|
data/Rakefile
CHANGED
@@ -87,6 +87,33 @@ task :manifest do
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
|
+
desc 'Package and upload the release to rubyforge.'
|
91
|
+
task :release do
|
92
|
+
require 'yaml'
|
93
|
+
require 'rubyforge'
|
94
|
+
|
95
|
+
meta = YAML::load open('.gemified')
|
96
|
+
version = meta[:version]
|
97
|
+
|
98
|
+
v = ENV['VERSION'] or abort "Must supply VERSION=x.y.z"
|
99
|
+
abort "Version doesn't match #{version}" if v != version
|
100
|
+
|
101
|
+
gem = "#{meta[:name]}-#{version}.gem"
|
102
|
+
project = meta[:rubyforge_project]
|
103
|
+
|
104
|
+
rf = RubyForge.new
|
105
|
+
puts "Logging in to RubyForge"
|
106
|
+
rf.login
|
107
|
+
|
108
|
+
c = rf.userconfig
|
109
|
+
c['release_notes'] = meta[:summary]
|
110
|
+
c['release_changes'] = File.read('CHANGELOG').split(/^== .+\n/)[1].strip
|
111
|
+
c['preformatted'] = true
|
112
|
+
|
113
|
+
puts "Releasing #{meta[:name]} #{version}"
|
114
|
+
rf.add_release project, project, version, gem
|
115
|
+
end
|
116
|
+
|
90
117
|
task :examples do
|
91
118
|
%x(haml examples/index.haml examples/index.html)
|
92
119
|
%x(sass examples/pagination.sass examples/pagination.css)
|
@@ -11,23 +11,12 @@ end
|
|
11
11
|
ActiveRecord::Associations::HasManyThroughAssociation ].each do |klass|
|
12
12
|
klass.class_eval do
|
13
13
|
protected
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
else
|
19
|
-
super
|
20
|
-
end
|
21
|
-
elsif @reflection.klass.scopes.include?(method)
|
22
|
-
@reflection.klass.scopes[method].call(self, *args)
|
14
|
+
alias :method_missing_without_scopes :method_missing_without_paginate
|
15
|
+
def method_missing_without_paginate(method, *args, &block)
|
16
|
+
if @reflection.klass.scopes.include?(method)
|
17
|
+
@reflection.klass.scopes[method].call(self, *args, &block)
|
23
18
|
else
|
24
|
-
|
25
|
-
if block_given?
|
26
|
-
@reflection.klass.send(method, *args) { |*block_args| yield(*block_args) }
|
27
|
-
else
|
28
|
-
@reflection.klass.send(method, *args)
|
29
|
-
end
|
30
|
-
end
|
19
|
+
method_missing_without_scopes(method, *args, &block)
|
31
20
|
end
|
32
21
|
end
|
33
22
|
end
|
@@ -47,4 +36,4 @@ ActiveRecord::Associations::HasAndBelongsToManyAssociation.class_eval do
|
|
47
36
|
end
|
48
37
|
end
|
49
38
|
end
|
50
|
-
end if ActiveRecord::
|
39
|
+
end if ActiveRecord::Base.respond_to? :find_first
|
@@ -140,7 +140,7 @@ module WillPaginate
|
|
140
140
|
end
|
141
141
|
|
142
142
|
def self.total_pages_for_collection(collection) #:nodoc:
|
143
|
-
if collection.respond_to?
|
143
|
+
if collection.respond_to?('page_count') and !collection.respond_to?('total_pages')
|
144
144
|
WillPaginate::Deprecation.warn <<-MSG
|
145
145
|
You are using a paginated collection of class #{collection.class.name}
|
146
146
|
which conforms to the old API of WillPaginate::Collection by using
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: will_paginate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Mislav Marohni\xC4\x87"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-04-
|
12
|
+
date: 2008-04-08 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|