magic_grid 0.12.5 → 0.12.6

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.
data/README.md CHANGED
@@ -2,6 +2,7 @@ MagicGrid
2
2
  =========
3
3
  © 2011-2013 Ryan Graham, Dennis Taylor
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/magic_grid.png)](http://badge.fury.io/rb/magic_grid)
5
6
  [![Build Status](https://travis-ci.org/rmg/magic_grid.png?branch=master)](https://travis-ci.org/rmg/magic_grid)
6
7
  [![Code Climate](https://codeclimate.com/badge.png)](https://codeclimate.com/github/rmg/magic_grid)
7
8
 
@@ -64,6 +65,12 @@ it generates. Make sure to include `magic_grid.js` in your view or application w
64
65
  ### :per_page
65
66
  Sets the number of rows per page in the paginator.
66
67
 
68
+ ### :title
69
+ Sets a text string to include in the top of the grid's `thead` to display as a title for the grid.
70
+
71
+ ### and more...
72
+ There's a.. *ahem* slight lack of documentation at the moment. Pull requests welcome?
73
+
67
74
  Development
68
75
  -----------
69
76
 
@@ -106,7 +106,7 @@ module MagicGrid
106
106
 
107
107
  def current_sort_col
108
108
  @current_sort_col ||= begin
109
- given = param(:col, -1)
109
+ given = param(:col, -1).to_i
110
110
  if given >= 0 and given <= columns.count
111
111
  given
112
112
  else
@@ -1,3 +1,3 @@
1
1
  module MagicGrid
2
- VERSION = "0.12.5"
2
+ VERSION = "0.12.6"
3
3
  end
@@ -197,8 +197,8 @@ describe MagicGrid::Collection do
197
197
  context "when #page (possibly from Kaminari) is available" do
198
198
  it "should call paginate helper when it is detected" do
199
199
  array = [1].tap do |a|
200
- a.should_receive(:per).with(1) { array }
201
- a.should_receive(:page).with(1) { array }
200
+ a.should_receive(:per).with(1).and_return(a)
201
+ a.should_receive(:page).with(1).and_return(a)
202
202
  end
203
203
  collection = MagicGrid::Collection.new(array, nil)
204
204
  collection.per_page = 1
@@ -212,11 +212,11 @@ describe MagicGrid::Collection do
212
212
  it "should call paginate helper when it is detected" do
213
213
  array = Array.new(10) { 1 }
214
214
  kaminaried_array = [1].tap do |ka|
215
- ka.should_receive(:per).with(1) { ka }
216
- ka.should_receive(:page).with(1) { ka }
215
+ ka.should_receive(:per).with(1).and_return(ka)
216
+ ka.should_receive(:page).with(1).and_return(ka)
217
217
  end
218
218
  kaminari = double.tap do |k|
219
- k.should_receive(:paginate_array).with(array) { kaminaried_array }
219
+ k.should_receive(:paginate_array).with(array).and_return(kaminaried_array)
220
220
  end
221
221
  collection = MagicGrid::Collection.new(array, nil)
222
222
  collection.per_page = 1
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: magic_grid
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.12.5
5
+ version: 0.12.6
6
6
  platform: ruby
7
7
  authors:
8
8
  - Ryan Graham
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-19 00:00:00.000000000 Z
12
+ date: 2013-07-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  prerelease: false
@@ -188,7 +188,8 @@ files:
188
188
  - test/dummy/app/helpers/application_helper.rb
189
189
  - test/magic_grid_test.rb
190
190
  homepage: https://github.com/rmg/magic_grid
191
- licenses: []
191
+ licenses:
192
+ - MIT
192
193
  post_install_message:
193
194
  rdoc_options: []
194
195
  require_paths:
@@ -199,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
199
200
  - !ruby/object:Gem::Version
200
201
  segments:
201
202
  - 0
202
- hash: -1526961715070354310
203
+ hash: 2102927067340220080
203
204
  version: '0'
204
205
  none: false
205
206
  required_rubygems_version: !ruby/object:Gem::Requirement
@@ -208,7 +209,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
209
  - !ruby/object:Gem::Version
209
210
  segments:
210
211
  - 0
211
- hash: -1526961715070354310
212
+ hash: 2102927067340220080
212
213
  version: '0'
213
214
  none: false
214
215
  requirements: []