kaminari 0.17.0 → 1.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of kaminari might be problematic. Click here for more details.

Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +0 -1
  3. data/.travis.yml +20 -39
  4. data/CHANGELOG.md +560 -0
  5. data/CONTRIBUTING.md +16 -0
  6. data/Gemfile +1 -0
  7. data/README.md +545 -0
  8. data/Rakefile +21 -24
  9. data/gemfiles/active_record_41.gemfile +2 -4
  10. data/gemfiles/active_record_42.gemfile +2 -4
  11. data/gemfiles/active_record_50.gemfile +20 -0
  12. data/gemfiles/active_record_edge.gemfile +5 -6
  13. data/kaminari.gemspec +11 -17
  14. data/lib/kaminari.rb +4 -39
  15. data/lib/kaminari/version.rb +2 -1
  16. metadata +44 -186
  17. data/.gemtest +0 -0
  18. data/.rspec +0 -2
  19. data/CHANGELOG.rdoc +0 -480
  20. data/README.rdoc +0 -336
  21. data/app/views/kaminari/_first_page.html.erb +0 -11
  22. data/app/views/kaminari/_first_page.html.haml +0 -9
  23. data/app/views/kaminari/_first_page.html.slim +0 -10
  24. data/app/views/kaminari/_gap.html.erb +0 -8
  25. data/app/views/kaminari/_gap.html.haml +0 -8
  26. data/app/views/kaminari/_gap.html.slim +0 -9
  27. data/app/views/kaminari/_last_page.html.erb +0 -11
  28. data/app/views/kaminari/_last_page.html.haml +0 -9
  29. data/app/views/kaminari/_last_page.html.slim +0 -10
  30. data/app/views/kaminari/_next_page.html.erb +0 -11
  31. data/app/views/kaminari/_next_page.html.haml +0 -9
  32. data/app/views/kaminari/_next_page.html.slim +0 -10
  33. data/app/views/kaminari/_page.html.erb +0 -12
  34. data/app/views/kaminari/_page.html.haml +0 -10
  35. data/app/views/kaminari/_page.html.slim +0 -11
  36. data/app/views/kaminari/_paginator.html.erb +0 -23
  37. data/app/views/kaminari/_paginator.html.haml +0 -18
  38. data/app/views/kaminari/_paginator.html.slim +0 -19
  39. data/app/views/kaminari/_prev_page.html.erb +0 -11
  40. data/app/views/kaminari/_prev_page.html.haml +0 -9
  41. data/app/views/kaminari/_prev_page.html.slim +0 -10
  42. data/config/locales/kaminari.yml +0 -19
  43. data/gemfiles/active_record_30.gemfile +0 -28
  44. data/gemfiles/active_record_31.gemfile +0 -26
  45. data/gemfiles/active_record_32.gemfile +0 -25
  46. data/gemfiles/active_record_40.gemfile +0 -26
  47. data/gemfiles/data_mapper_12.gemfile +0 -32
  48. data/gemfiles/mongo_mapper.gemfile +0 -25
  49. data/gemfiles/mongoid_30.gemfile +0 -22
  50. data/gemfiles/mongoid_31.gemfile +0 -21
  51. data/gemfiles/mongoid_40.gemfile +0 -19
  52. data/gemfiles/mongoid_50.gemfile +0 -23
  53. data/gemfiles/sinatra_13.gemfile +0 -36
  54. data/gemfiles/sinatra_14.gemfile +0 -33
  55. data/lib/generators/kaminari/config_generator.rb +0 -16
  56. data/lib/generators/kaminari/templates/kaminari_config.rb +0 -10
  57. data/lib/generators/kaminari/views_generator.rb +0 -119
  58. data/lib/kaminari/config.rb +0 -51
  59. data/lib/kaminari/engine.rb +0 -4
  60. data/lib/kaminari/grape.rb +0 -4
  61. data/lib/kaminari/helpers/action_view_extension.rb +0 -132
  62. data/lib/kaminari/helpers/paginator.rb +0 -195
  63. data/lib/kaminari/helpers/sinatra_helpers.rb +0 -176
  64. data/lib/kaminari/helpers/tags.rb +0 -108
  65. data/lib/kaminari/hooks.rb +0 -53
  66. data/lib/kaminari/models/active_record_extension.rb +0 -22
  67. data/lib/kaminari/models/active_record_model_extension.rb +0 -22
  68. data/lib/kaminari/models/active_record_relation_methods.rb +0 -42
  69. data/lib/kaminari/models/array_extension.rb +0 -66
  70. data/lib/kaminari/models/configuration_methods.rb +0 -48
  71. data/lib/kaminari/models/data_mapper_collection_methods.rb +0 -19
  72. data/lib/kaminari/models/data_mapper_extension.rb +0 -51
  73. data/lib/kaminari/models/mongo_mapper_extension.rb +0 -18
  74. data/lib/kaminari/models/mongoid_criteria_methods.rb +0 -40
  75. data/lib/kaminari/models/mongoid_extension.rb +0 -26
  76. data/lib/kaminari/models/page_scope_methods.rb +0 -73
  77. data/lib/kaminari/models/plucky_criteria_methods.rb +0 -23
  78. data/lib/kaminari/railtie.rb +0 -7
  79. data/lib/kaminari/sinatra.rb +0 -7
  80. data/spec/config/config_spec.rb +0 -91
  81. data/spec/fake_app/active_record/config.rb +0 -3
  82. data/spec/fake_app/active_record/models.rb +0 -65
  83. data/spec/fake_app/data_mapper/config.rb +0 -1
  84. data/spec/fake_app/data_mapper/models.rb +0 -27
  85. data/spec/fake_app/mongo_mapper/config.rb +0 -2
  86. data/spec/fake_app/mongo_mapper/models.rb +0 -9
  87. data/spec/fake_app/mongoid/config.rb +0 -20
  88. data/spec/fake_app/mongoid/models.rb +0 -38
  89. data/spec/fake_app/rails_app.rb +0 -56
  90. data/spec/fake_app/sinatra_app.rb +0 -22
  91. data/spec/fake_app/views/alternative/kaminari/_first_page.html.erb +0 -1
  92. data/spec/fake_app/views/alternative/kaminari/_paginator.html.erb +0 -3
  93. data/spec/fake_app/views/kaminari/bootstrap/_page.html.erb +0 -1
  94. data/spec/fake_app/views/kaminari/bootstrap/_paginator.html.erb +0 -7
  95. data/spec/fake_gem.rb +0 -20
  96. data/spec/generators/views_generator_spec.rb +0 -18
  97. data/spec/helpers/action_view_extension_spec.rb +0 -318
  98. data/spec/helpers/helpers_spec.rb +0 -144
  99. data/spec/helpers/sinatra_helpers_spec.rb +0 -223
  100. data/spec/helpers/tags_spec.rb +0 -140
  101. data/spec/models/active_record/active_record_relation_methods_spec.rb +0 -77
  102. data/spec/models/active_record/inherited_spec.rb +0 -9
  103. data/spec/models/active_record/scopes_spec.rb +0 -265
  104. data/spec/models/array_spec.rb +0 -172
  105. data/spec/models/configuration_methods_spec.rb +0 -125
  106. data/spec/models/data_mapper/data_mapper_spec.rb +0 -205
  107. data/spec/models/mongo_mapper/mongo_mapper_spec.rb +0 -84
  108. data/spec/models/mongoid/mongoid_spec.rb +0 -228
  109. data/spec/requests/users_spec.rb +0 -53
  110. data/spec/spec_helper.rb +0 -34
  111. data/spec/spec_helper_for_sinatra.rb +0 -34
  112. data/spec/support/database_cleaner.rb +0 -19
  113. data/spec/support/matchers.rb +0 -52
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f6f180b0164209c6b789f3ae855089840a905fd
4
- data.tar.gz: 2bbc06afb48a4e28ca76f7c960b359eb440f4dc9
3
+ metadata.gz: 853deef8f064de3a89cd328b82dee53d117923bc
4
+ data.tar.gz: 5a487bda1014595b01e3746590626b6b171c6327
5
5
  SHA512:
6
- metadata.gz: f3e4ac52fe8981e2610495da987398d455e25984d27a558f98175b512f22a938c58798225be16d526f38c6d19f9a1e1274612d6cf9e68e11f06bd4f4b8b0838a
7
- data.tar.gz: 4f162bbb0935a179d6586316e9d3cf476ce1db7d15a61698c83313edf8c367b0df9ac14b99148e2153102f807f54d55fc1fe29894168417371b1954bf035ad63
6
+ metadata.gz: 20d621b0480fd312a4f5a05763bf20813444fdb645480528d932e3dc1bb36ae647b366e5f8363f5984429fa89931912f4034d5e4b711895d8292c190e8c1173c
7
+ data.tar.gz: a4127bf0d8a576db20aeca817ef3b93d69fe28b66c946c345b140c019da64d5f62f27d1646093d675308f7dc0f6354455e5e2a2fb3924d9655fb97b7b4e7a0ad
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  *.gem
2
2
  .bundle
3
- .idea
4
3
  Gemfile.lock
5
4
  gemfiles/*.lock
6
5
  coverage/*
@@ -1,64 +1,45 @@
1
1
  language: ruby
2
2
 
3
3
  rvm:
4
- - 1.9.3
5
4
  - 2.0.0
6
5
  - 2.1.10
7
- - 2.2.5
8
- - 2.3.1
9
- - jruby-1.7.25
10
- - jruby-9.1.0.0
11
- - rbx-2
6
+ - 2.2.6
7
+ - 2.3.3
8
+ - ruby-head
9
+ - jruby-9.1.5.0
10
+ - rbx
12
11
 
13
12
  gemfile:
14
- - gemfiles/active_record_30.gemfile
15
- - gemfiles/active_record_31.gemfile
16
- - gemfiles/active_record_32.gemfile
17
- - gemfiles/active_record_40.gemfile
18
13
  - gemfiles/active_record_41.gemfile
19
14
  - gemfiles/active_record_42.gemfile
15
+ - gemfiles/active_record_50.gemfile
20
16
  - gemfiles/active_record_edge.gemfile
21
- - gemfiles/data_mapper_12.gemfile
22
- - gemfiles/mongo_mapper.gemfile
23
- - gemfiles/mongoid_30.gemfile
24
- - gemfiles/mongoid_31.gemfile
25
- - gemfiles/mongoid_40.gemfile
26
- - gemfiles/mongoid_50.gemfile
27
- - gemfiles/sinatra_13.gemfile
28
- - gemfiles/sinatra_14.gemfile
29
17
 
30
18
  sudo: false
31
19
 
32
- services: mongodb
33
-
34
- script: "bundle exec rake spec"
20
+ script: 'bundle exec rake test'
35
21
 
36
22
  cache: bundler
37
23
 
38
24
  matrix:
39
25
  exclude:
40
- - rvm: 1.9.3
41
- gemfile: gemfiles/active_record_edge.gemfile
26
+ - rvm: 2.0.0
27
+ gemfile: gemfiles/active_record_50.gemfile
28
+ - rvm: 2.1.10
29
+ gemfile: gemfiles/active_record_50.gemfile
42
30
  - rvm: 2.0.0
43
31
  gemfile: gemfiles/active_record_edge.gemfile
44
32
  - rvm: 2.1.10
45
33
  gemfile: gemfiles/active_record_edge.gemfile
46
- - rvm: 2.2.5
47
- gemfile: gemfiles/active_record_30.gemfile
48
- - rvm: 2.2.5
49
- gemfile: gemfiles/active_record_31.gemfile
50
- - rvm: 2.2.5
51
- gemfile: gemfiles/active_record_32.gemfile
52
- - rvm: 2.3.1
53
- gemfile: gemfiles/active_record_30.gemfile
54
- - rvm: 2.3.1
55
- gemfile: gemfiles/active_record_31.gemfile
56
- - rvm: 2.3.1
57
- gemfile: gemfiles/active_record_32.gemfile
58
- - rvm: jruby-1.7.25
34
+ - rvm: ruby-head
35
+ gemfile: gemfiles/active_record_41.gemfile
36
+ - rvm: rbx
37
+ gemfile: gemfiles/active_record_50.gemfile
38
+ - rvm: rbx
59
39
  gemfile: gemfiles/active_record_edge.gemfile
60
40
  allow_failures:
61
- - rvm: jruby-1.7.25
62
- - rvm: jruby-9.1.0.0
63
- - rvm: rbx-2
41
+ - rvm: ruby-head
42
+ - rvm: jruby-9.1.5.0
43
+ - rvm: rbx
44
+ - gemfile: gemfiles/active_record_edge.gemfile
64
45
  fast_finish: true
@@ -0,0 +1,560 @@
1
+ ## 1.0.0
2
+
3
+ ### Breaking Changes:
4
+
5
+ * Dropped Ruby 1.9 support
6
+
7
+ * Dropped Rails 3.2 support
8
+
9
+ * Dropped Rails 4.0 support
10
+
11
+ * Removed Sinatra support that has been extracted to kaminari-sinatra gem
12
+
13
+ * Removed Mongoid support that has been extracted to kaminari-mongoid gem
14
+
15
+ * Removed MongoMapper support that has been extracted to kaminari-mongo_mapper gem
16
+
17
+ * Removed DataMapper support that has been extracted to kaminari-data_mapper gem
18
+
19
+ * Extracted Grape support to kaminari-grape gem and removed it from the core
20
+
21
+ * Splitted the gem into 3 internal gems:
22
+ * The core pagination logic (kaminari-core)
23
+ * Active Record adapter (kaminari-activerecord)
24
+ * Action View adapter (kaminari-actionview)
25
+
26
+ * Removed deprecated `num_pages` API in favor of `total_pages`
27
+
28
+ * Deprecated `-e haml` and `-e slim` options for the views generator
29
+
30
+ * Renamed the model class method for configuring `max_pages` from `max_pages_per` to `max_pages`
31
+
32
+ ### Enhancements:
33
+
34
+ * Exposed `path_to_prev_page`, `path_to_next_page` helpers as public API #683 [@neilang]
35
+
36
+ * Added `--views_prefix` option for the views generator #668 [@antstorm]
37
+
38
+ * Added `max_paginates_per` scope method to overwrite model `max_paginates_per` config #754 [@rubyonme]
39
+
40
+ * Added `:paginator_class` option to specify a custom Paginator for `paginate` #740 [@watsonbox]
41
+
42
+ * Use I18n to pluralize entries in `page_entries_info` #694 [@Linuus]
43
+
44
+ * Added `without_count` #681 [@bryanrite]
45
+
46
+ * Omit select count query for `total_count` if it's calculable in Ruby level from loaded records
47
+
48
+ ### Bug Fixes:
49
+
50
+ * Fixed a bug that a single page gap was displayed as "…"
51
+
52
+ ```
53
+ before: ‹ 1 2 … 4 5 [6] 7 8 … 15 16 ›
54
+ after: ‹ 1 2 3 4 5 [6] 7 8 … 15 16 ›
55
+ ```
56
+
57
+ * Fixed a bug where `paginate` changes request.format #540 [@jasonkim]
58
+
59
+ * Fixed a bug where `per(nil)` didn't respect `max_per_page` configuration #800 [@jonathanhefner]
60
+
61
+ * Fixed a bug that model class' `max_paginates_per` was ignored when it's smaller than the default `per_page`
62
+
63
+ * Preserve source location of the pagination method #812 [@ka8725]
64
+
65
+ * Preserve source location of the tag helpers
66
+
67
+ * Hide Next & Last buttons if page is out of range #712 [@igorkasyanchuk]
68
+
69
+ * Always buffer with `ActionView::OutputBuffer` if Action View is loaded #804 [@onemanstartup]
70
+
71
+
72
+ ## 0.17.0
73
+
74
+ * Rails 5 ready!
75
+
76
+ * Mongoid 5.0 support
77
+
78
+ * Dropped Ruby 1.8 support
79
+
80
+ * Dropped Mongoid 2.x support
81
+
82
+ * Extracted Sinatra support to kaminari-sinatra gem
83
+
84
+ * Extracted DataMapper support to kaminari-data_mapper gem
85
+
86
+ * Extracted Mongoid support to kaminari-mongoid gem
87
+
88
+ * Extracted MongoMapper support to kaminari-mongo_mapper gem
89
+
90
+ * Deprecated `Kaminari::PageScopeMethods#num_pages` in favor of `total_pages`
91
+
92
+ * Deprecated `:num_pages` option for `paginate` in favor of `:total_pages`
93
+
94
+ * Fixed mangled params in pagination links on Rails 5 #766 [@audionerd]
95
+
96
+ * Fixed a bug where the range of the records displayed on the last page doesn't match #718 [@danzanzini]
97
+
98
+
99
+ ## 0.16.3
100
+
101
+ * Fixed a "stack level too deep" bug in mongoid #642 [@bartes]
102
+
103
+ * Fixed a bug that Kaminari possibly crashes when combined with other gems that define `inherited` method on model classes, such as aasm. #651 [@zeitnot]
104
+
105
+
106
+ ## 0.16.2
107
+
108
+ * Fixed a bug where cloned Relations remember previous relations' `@total_count` value #565 [@inkstak]
109
+
110
+ * Fixed a bug where `paginate_array()` with `total_count` option returns whole array for every page #516 [@abhichvn]
111
+
112
+ * Fixed a bug where `:num_pages` option was backwards-incompatible #605 [@klebershimabuku]
113
+
114
+ * Fixed a bug where themed views generator attempts to overwrite README.md #623 [@swrobel]
115
+
116
+ * Fixed a bug that ruby raises a NameError when theme was not found #622 [@maxprokopiev]
117
+
118
+ * Fixed a bug that `paginates_per` does not work with subclasses on mongoid #634 [@kouyaf77]
119
+
120
+ * Show an error message if a proper template was not found for the generator theme #600 [@meltedice]
121
+
122
+
123
+ ## 0.16.1
124
+
125
+ * Fix a bug where `:theme` option for #paginate method doesn't work properly #566 [@commstratdev]
126
+
127
+
128
+ ## 0.16.0
129
+
130
+ * Add support for mongoid `max_scan` option #500 [@aptx4869]
131
+
132
+ * Add `link_to_previous_page` helper for Sinatra #504 [@ikeay]
133
+
134
+ * Add `:views_prefix` option to `#paginate` for alternative views directory #552 [@apotonick]
135
+
136
+ * Simplify `page_entries_info` by adding `entry_name` interface to each ORM
137
+
138
+ * Refer ActiveRecord::Base from top level namespace for more safety when inherited class's namespace has `ActiveRecord` constant #522 [@yuroyoro]
139
+
140
+ * Fix a bug where runtime persistence not taken into account with mongoid/kaminari #326 [@nubeod]
141
+
142
+ * Fix a bug where helper methods were not available from inside `paginator.render do ... end` block #239 [@damien-roche]
143
+
144
+ * Fix a bug where theme generator didn't work on Rails 4.1 #526 [@jimryan]
145
+
146
+ * Fix a bug that paginatable arrays with `total_count` option always returns whole array #516 [@abhichvn]
147
+
148
+
149
+ ## 0.15.1
150
+
151
+ * `page_method_name` option was not working in 0.15.0 #481 [@mauriciopasquier]
152
+
153
+ * Use the mongoid criteria #length method to cache the count of the collection per criteria #484 [@camallen]
154
+
155
+ * Don't inherit `host`, `port`, and `protocol` from the given params
156
+
157
+
158
+ ## 0.15.0
159
+
160
+ * Allow `count`, `total_count` to pass parameters to super #193 [@bsimpson]
161
+
162
+ * Add `max_pages` and `max_pages_per` methods to limit displayed pages per model or globally #301 [@zpieslak]
163
+
164
+ * Add support for Sinatra views overrides (add app views paths) #332 [@j15e]
165
+
166
+ * Fix wrong pagination when used with `padding` #359 [@vladimir-vg, @negipo]
167
+
168
+ * check for Hash in addition to OrderedHash, which seems to break in Rails 4, for total_count #369 [@aew]
169
+
170
+ * Make `to_s` in paginator threadsafe #374 [@bf4]
171
+
172
+ * Fix Missing partial Error when `paginate` called from different format template #381 [@joker1007]
173
+
174
+ * Add `PageScopeMethods#next_page`, `prev_page`, and `out_of_range?` [@yuki24]
175
+
176
+ * Use `html_safe` in view partials instead of `raw` fixed #73 [@zzak]
177
+
178
+ * Fix a bug that `PaginatableArray#total_pages` returns the wrong value #416 [@yuki24]
179
+
180
+ * Make `num_pages` to return the same value as `total_pages` for backward compat [@yuki24, @eitoball]
181
+
182
+ * Change `#page_entries_info` to use model name #340, #348 [@znz, @eitoball]
183
+
184
+ * Change scope to class method #433 [@kolodovskyy]
185
+
186
+ * Fix arity problem with Rails 4.1.0 #449 [@bricker]
187
+
188
+
189
+ ## 0.14.1
190
+
191
+ * Changed the default "truncation" String from "..." to "…" #264 [@pjaspers]
192
+
193
+ * The theme generator is Github API v3 compatible now! #279 [@eitoball]
194
+
195
+ * Made `Kaminari.config.default_per_page` changeable again #280 [@yuki24]
196
+
197
+
198
+ ## 0.14.0
199
+
200
+ * Grape framework support! #218 [@mrplum]
201
+
202
+ * Mongoid 3 ready! #238 [@shingara]
203
+
204
+ * Added `link_to_previous_page` helper #191 [@timgremore]
205
+
206
+ * Added helper to generate rel="next" and rel="prev" link tags for SEO #200 [@joe1chen]
207
+
208
+ * Added `max_per_page` configuration option #274 [@keiko0713]
209
+
210
+ This would be useful for the case when you are using user input `per_page` value but want to impose the upper bound.
211
+
212
+ * Added I18n to `page_entries_info` #207 [@plribeiro3000]
213
+
214
+ * Changed method name `num_pages` to `total_pages`
215
+
216
+ `num_pages` is still available as an alias of `total_pages`, but will be deprecated or removed in some future version.
217
+
218
+ * Changed the way `page_entries_info` behave so it can show appropriate names for models with namespace #207 [@plribeiro3000]
219
+
220
+ * Added `html_safe` to `page_entries_info` helper #190 [@lucapette]
221
+
222
+ * Fixed displayed number of items on each page w/ Mongoid 2.4.x and MongoMapper #194 [@dblock]
223
+
224
+ * Removed a unused local variable from templates from default tamplate #245 [@juno]
225
+
226
+ * Fixed `page_entry_info` to use the value of `entry_name` option when given collection is empty or a PaginatableArray #265, #277 [@eitoball]
227
+
228
+ * Added require 'dm-aggregates' in DataMapper hook #259 [@shingara]
229
+
230
+
231
+ ## 0.13.0
232
+
233
+ * Rails 3.2 ready! #180 [@slbug]
234
+
235
+ * DataMapper support! #149 [@NoICE, @Ragmaanir]
236
+
237
+ * Sinatra & Padrino support! #179 [@udzura, @mlightner, @aereal]
238
+
239
+ * Added mongoid embedded documents support! #155 [@yuki24]
240
+
241
+ * Added `each_relevant_page` that only visits pages in the inner or outer windows. Performance improved, particularly with very large number of pages. #154 [@cbeer]
242
+
243
+ * Memoize count for AR when calling `total_count`. Increases performance for large datasets. #138 [@sarmiena]
244
+
245
+ * Added `page_entries_info` view helper #140 [@jeffreyiacono]
246
+ ```
247
+ <%= page_entries_info @posts %>
248
+ #=> Displaying posts 6 - 10 of 26 in total
249
+ ```
250
+
251
+ * Added `link_to_next_page` helper method that simply links to the next page
252
+ ```
253
+ <%= link_to_next_page @posts, 'More' %>
254
+ #=> <a href="/posts?page=7" rel="next">More</a>
255
+ ```
256
+
257
+ * Let one override the `rel` attribute for `link_to_next_page` helper #177 [@webmat]
258
+
259
+ * Added `total_count` param for PaginatableArray. Useful for when working with RSolr #141 [@samdalton]
260
+
261
+ * Changed `Kaminari.paginate_array` API to take a Hash `options` And specifying :limit & :offset immediately builds a pagination ready object
262
+ ```ruby
263
+ # the following two are equivalent. Use whichever you like
264
+ Kaminari.paginate_array((1..100).to_a, limit: 10, offset: 10)
265
+ Kaminari.paginate_array((1..100).to_a).page(2).per(10)
266
+ ```
267
+
268
+ * Added `padding` method to skip an arbitrary record count #60 [@aaronjensen]
269
+ ```ruby
270
+ User.page(2).per(10).padding(3) # this will return users 14..23
271
+ ```
272
+
273
+ * Made the pagination method name (defaulted to `page`) configurable #57, #162
274
+ ```ruby
275
+ # you can use the config file and its generator for this
276
+ Kaminari.config.page_method_name = :paging
277
+ Article.paging(3).per(30)
278
+ ```
279
+
280
+ * Only add extensions to direct descendents of ActiveRecord::Base #108 [@seejohnrun]
281
+
282
+ * AR models that were subclassed before Kaminari::ActiveRecordExtension is included pick up the extensions #119 [@pivotal-casebook]
283
+
284
+ * Avoid overwriting AR::Base inherited method #165 [@briandmcnabb]
285
+
286
+ * Stopped depending on Rails gem #159 [@alsemyonov]
287
+
288
+ * introduced Travis CI #181 [@hsbt]
289
+
290
+
291
+ ## 0.12.4
292
+
293
+ * Support for `config.param_name` as lambda #102 [@ajrkerr]
294
+
295
+ * Stop duplicating `order_values` #65 [@zettabyte]
296
+
297
+ * Preserve select value (e.g. "distinct") when counting #77, #104 [@tbeauvais, @beatlevic]
298
+
299
+
300
+ ## 0.12.3
301
+
302
+ * Haml 3.1 Support #96 [@FlyboyArt, @sonic921]
303
+
304
+
305
+ ## 0.12.2
306
+
307
+ * Added MongoMapper Support #101 [@hamin]
308
+
309
+ * Add `first_page?` and `last_page?` to `page_scope_methods` #51 [@holinnn]
310
+
311
+ * Make sure that the paginate helper always returns a String #99 [@Draiken]
312
+
313
+ * Don't remove includes scopes from count if they are needed #100 [@flop]
314
+
315
+
316
+ ## 0.12.1
317
+
318
+ * Slim template support #93 [@detrain]
319
+
320
+ * Use Kaminari.config to specify default value for `param_name` #94 [@avsej]
321
+
322
+ * Fixed "super called outside of method" error happened in particular versions of Ruby 1.8.7 #91 [@Skulli]
323
+
324
+ * `_paginate.html.erb` isn't rendered with custom theme #97 [@danlunde]
325
+
326
+
327
+ ## 0.12.0
328
+
329
+ * General configuration options #41 #62 [@javierv, @iain]
330
+
331
+ You can now globally override some default values such as `default_per_page`, `window`, etc. via configuration file.
332
+ Also, here comes a generator command that generates the default configuration file into your app's config/initilizers directory.
333
+
334
+ * Generic pagination support for Array object #47 #68 #74 [@lda, @ened, @jianlin]
335
+
336
+ You can now paginate through any kind of Arrayish object in this way:
337
+ ```ruby
338
+ Kaminari.paginate_array(my_array_object).page(params[:page]).per(10)
339
+ ```
340
+
341
+ * Fixed a serious performance regression on #count method in 0.11.0 [@ankane]
342
+
343
+ * Bugfix: Pass the real @params to `url_for` #90 [@utkarshkukreti]
344
+
345
+ * Fixed a gem packaging problem (circular dependency)
346
+
347
+ There was a packaging problem with Kaminari 0.11.0 that the gem depends on Kaminari gem. Maybe Jeweler + "gemspec" method didn't work well...
348
+
349
+
350
+ ## 0.11.0
351
+
352
+ This release contains several backward incompatibilities on template API. You probably need to update your existing templates if you're already using your own custom theme.
353
+
354
+ * Merge `_current_page`, `_first_page_link`, `_last_page_link` and `_page_link` into one `_page` partial #28 [@GarthSnyder]
355
+
356
+ * Add real first/last page links, and use them by default instead of outer window #30 [@GarthSnyder]
357
+
358
+ * The disabled items should simply not be emitted, even as an empty span #30 [@GarthSnyder]
359
+
360
+ * Skip :order in `#count_all` so complex groups with generated columns don't blow up in SQL-land #61 [@keeran, @Empact]
361
+
362
+ * Ignore :include in `#count_all` to make it work better with polymorphic eager loading #80 [@njakobsen]
363
+
364
+ * Quick fix on `#count` to return the actual number of records on AR 3.0 #45 #50
365
+
366
+ * Removed "TERRIBLE HORRIBLE NO GOOD VERY BAD HACK" #82 [@janx, @flop, @pda]
367
+
368
+ * Allow for Multiple Themes #64 [@tmilewski]
369
+
370
+ * Themes can contain the whole application directory structure now
371
+
372
+ * Use `gemspec` method in Gemfile [@p_elliott]
373
+
374
+
375
+ ## 0.10.4
376
+
377
+ * Do not break ActiveRecord::Base.descendants, by making sure to call super from ActiveRecord::Base.inherited #34 [@rolftimmermans]
378
+
379
+ * Fixed vanishing mongoid criteria after calling `page()` #26 [@tyok]
380
+
381
+
382
+ ## 0.10.3
383
+
384
+ * Fixed a bug that `total_count()` didn't work when chained with `group()` scope #21 [@jgeiger]
385
+
386
+ * Fixed a bug that the paginate helper didn't work properly with an Ajax call #23 [@hjuskewycz]
387
+
388
+
389
+ ## 0.10.2
390
+
391
+ * Added `:param_name` option to the pagination helper #10 [@ivanvr]
392
+
393
+ ```haml
394
+ = paginate @users, :param_name => :pagina
395
+ ```
396
+
397
+
398
+ ## 0.10.1
399
+
400
+ * Fixed a bug that the whole `<nav>` section was not rendered in some cases [@GarthSnyder]
401
+
402
+
403
+ ## 0.10.0
404
+
405
+ * Railtie initializer name is "kaminari" from now
406
+
407
+ * Changed bundler settings to work both on 1.9.2 and 1.8.7 #12 [@l15n]
408
+
409
+ * Fixed bugs encountered when running specs on Ruby 1.9.2 #12 [@l15n]
410
+
411
+ * Clean up documentation (formatting and editing) #12 [@l15n]
412
+
413
+ * Use `Proc.new` instead of lambda for `scoped_options` #13 [@l15n]
414
+
415
+ * Use AS hooks for loading AR #14 [@hasimo]
416
+
417
+ * Refactor scope definition with Concerns #15 [@l15n]
418
+
419
+ * Ensure `output_buffer` is always initialized #11 [@kichiro]
420
+
421
+
422
+ ## 0.9.13
423
+
424
+ * Added Mongoid support #5 [@juno, @hibariya]
425
+
426
+ This means, Kaminari is now *ORM agnostic* ☇3☇3☇3
427
+
428
+
429
+ ## 0.9.12
430
+
431
+ * Moved the whole pagination logic to the paginator partial so that users can touch it
432
+
433
+ Note: You need to update your `_paginator.html.*` if you've already customized it.
434
+ If you haven't overridden `_paginator.html.*` files, then probably there're nothing you have to do.
435
+ See this commit for the example: https://github.com/amatsuda/kaminari_themes/commit/2dfb41c
436
+
437
+ ## 0.9.10
438
+
439
+ * the `per()` method accepts String, zero and minus value now #7 [@koic]
440
+
441
+ This enables you to do something like this:
442
+ ```ruby
443
+ Model.page(params[:page]).per(params[:per])
444
+ ```
445
+
446
+ * Added support for Gem Testers (http://gem-testers.org/) #8 [@joealba]
447
+
448
+
449
+ ## 0.9.9
450
+
451
+ * `:params` option for the helper [@yomukaku_memo]
452
+
453
+ You can override each link's `url_for` option by this option
454
+ ```haml
455
+ = paginate @users, :params => {:controller => 'users', :action => 'index2'}
456
+ ```
457
+
458
+ * refactor tags
459
+
460
+
461
+ ## 0.9.8
462
+
463
+ * I18n for the partials `:previous`, `:next`, and `:truncate` are externalized to the I18n resource.
464
+
465
+
466
+ ## 0.9.7
467
+
468
+ * moved template themes to another repo https://github.com/amatsuda/kaminari_themes
469
+
470
+
471
+ ## 0.9.6
472
+
473
+ * added `paginates_per` method for setting default `per_page` value for each model in a declarative way
474
+
475
+ ```ruby
476
+ class Article < ActiveRecord::Base
477
+ paginates_per 10
478
+ end
479
+ ```
480
+
481
+
482
+ ## 0.9.5
483
+
484
+ * works on AR 3.0.0 and 3.0.1 now #4 [@danillos]
485
+
486
+
487
+ ## 0.9.4
488
+
489
+ * introduced module based tags
490
+
491
+ As a side effect of this internal change, I have to confess that this version brings you a slight backward incompatibility on template API.
492
+ If you're using custom templates, be sure to update your existing templates. To catch up the new API, you need to update %w[next_url prev_url page_url] local variables to simple 'url' like this. https://github.com/amatsuda/kaminari/commit/da88729
493
+
494
+
495
+ ## 0.9.3
496
+
497
+ * improved template detection logic
498
+
499
+ When a template for a tag could not be found in the app/views/kaminari/ directory, it searches the tag's ancestor template files before falling back to engine's default template. This may help keeping your custom templates DRY.
500
+
501
+ * simplified bundled template themes
502
+
503
+
504
+ ## 0.9.2
505
+
506
+ * stop adding extra LF between templates when joining
507
+
508
+ * githubish template theme [@maztomo]
509
+
510
+
511
+ ## 0.9.1
512
+
513
+ * googlish template theme [@maztomo]
514
+
515
+
516
+ ## 0.9.0
517
+
518
+ * added `per_page` to the template local variables #3 [@hsbt]
519
+
520
+ * show no contents when the current page is the only page (in other words, `num_pages == 1`) #2 [@hsbt]
521
+
522
+
523
+ ## 0.8.0
524
+
525
+ * using HTML5 `<nav>` tag rather than `<div>` for the container tag
526
+
527
+
528
+ ## 0.7.0
529
+
530
+ * Ajaxified paginator templates
531
+
532
+
533
+ ## 0.6.0
534
+
535
+ * Hamlized paginator templates
536
+
537
+
538
+ ## 0.5.0
539
+
540
+ * reset `content_for :kaminari_paginator_tags` before rendering #1 [@hsbt]
541
+
542
+
543
+ ## 0.4.0
544
+
545
+ * partialize the outer div
546
+
547
+
548
+ ## 0.3.0
549
+
550
+ * suppress logging when rendering each partial
551
+
552
+
553
+ ## 0.2.0
554
+
555
+ * default `PER_PAGE` to 25 [@hsbt]
556
+
557
+
558
+ ## 0.1.0
559
+
560
+ * First release