kaminari 0.17.0 → 1.0.0

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