Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: mislav/will_paginate
base: master
...
head fork: vibes/will_paginate
compare: 9195298858146121da9ebde220e696d7ef24c29e
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
View
16 lib/will_paginate/finder.rb
@@ -76,10 +76,18 @@ def paginate(*args)
WillPaginate::Collection.create(page, per_page, total_entries) do |pager|
count_options = options.except :page, :per_page, :total_entries, :finder
find_options = count_options.except(:count).update(:offset => pager.offset, :limit => pager.per_page)
-
- args << find_options
- # @options_from_last_find = nil
- pager.replace(send(finder, *args) { |*a| yield(*a) if block_given? })
+
+ if respond_to?(:proxy_reflection) && !proxy_reflection.options[:finder_sql].nil?
+ sql = @finder_sql
+ sql += sanitize_sql [" LIMIT ?", pager.per_page]
+ sql += sanitize_sql [" OFFSET ?", pager.offset]
+
+ pager.replace(send("find_by_sql", sql) { |*a| yield(*a) if block_given? })
+ else
+ args << find_options
+ # @options_from_last_find = nifl
+ pager.replace(send(finder, *args) { |*a| yield(*a) if block_given? })
+ end
# magic counting for user convenience:
pager.total_entries = wp_count(count_options, args, finder) unless pager.total_entries
View
4 lib/will_paginate/view_helpers.rb
@@ -183,6 +183,10 @@ def page_entries_info(collection, options = {})
end
end
+ if respond_to? :safe_helper
+ safe_helper :will_paginate, :paginated_section, :page_entries_info
+ end
+
def self.total_pages_for_collection(collection) #:nodoc:
if collection.respond_to?('page_count') and !collection.respond_to?('total_pages')
WillPaginate::Deprecation.warn %{
View
2  will_paginate.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'will_paginate'
- s.version = '2.3.11'
+ s.version = '2.3.12'
s.date = '2009-06-02'
s.summary = "Most awesome pagination solution for Rails"

No commit comments for this range

Something went wrong with that request. Please try again.