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 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 default
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
- def method_missing_without_paginate(method, *args)
15
- if @target.respond_to?(method) || (!@reflection.klass.respond_to?(method) && Class.respond_to?(method))
16
- if block_given?
17
- super { |*block_args| yield(*block_args) }
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
- with_scope construct_scope do
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::VERSION::MAJOR < 2
39
+ end if ActiveRecord::Base.respond_to? :find_first
@@ -2,7 +2,7 @@ module WillPaginate #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 2
4
4
  MINOR = 2
5
- TINY = 0
5
+ TINY = 1
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -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? :page_count and !collection.respond_to? :total_pages
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.0
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-07 00:00:00 +02:00
12
+ date: 2008-04-08 00:00:00 +02:00
13
13
  default_executable:
14
14
  dependencies: []
15
15