objectreload-pagination 0.1.12 → 0.1.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/pagination/collection.rb +3 -2
  3. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.12
1
+ 0.1.13
@@ -5,10 +5,11 @@ module Pagination
5
5
  def initialize(options = {})
6
6
  @collection = options[:collection]
7
7
 
8
- if (already_paginated = ([:current_page, :per_page, :total_entries].all? { |m| @collection.respond_to?(m) }))
8
+ if (already_paginated = ([:current_page, :per_page, :total_entries, :total_pages].all? { |m| @collection.respond_to?(m) }))
9
9
  @current_page = @collection.current_page
10
10
  @per_page = @collection.per_page
11
- self.total_entries ||= @collection.total_entries
11
+ @total_entries = @collection.total_entries
12
+ @total_pages = @collection.total_pages
12
13
  else
13
14
  @current_page = options[:current_page].to_i
14
15
  @per_page = options[:per_page].to_i
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: objectreload-pagination
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 12
10
- version: 0.1.12
9
+ - 13
10
+ version: 0.1.13
11
11
  platform: ruby
12
12
  authors:
13
13
  - Mateusz Drozdzynski