JasonKing-good_sort 0.1.5 → 0.1.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/lib/good_sort/will_paginate.rb +14 -0
- data/lib/good_sort.rb +5 -0
- metadata +2 -1
@@ -0,0 +1,14 @@
|
|
1
|
+
module GoodSort
|
2
|
+
module WillPaginate
|
3
|
+
def self.included(base)
|
4
|
+
base.send :include, InstanceMethods
|
5
|
+
base.alias_method_chain :will_paginate, :good_sort
|
6
|
+
end
|
7
|
+
|
8
|
+
module InstanceMethods
|
9
|
+
def will_paginate_with_good_sort( collection = nil, options = {} )
|
10
|
+
will_paginate_without_good_sort( collection, options.merge( :remote => @remote_options, :params => params ) )
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
data/lib/good_sort.rb
CHANGED
@@ -6,6 +6,11 @@ module GoodSort
|
|
6
6
|
|
7
7
|
require 'good_sort/sorter'
|
8
8
|
ActiveRecord::Base.send :extend, Sorter
|
9
|
+
|
10
|
+
if ActionView::Base.instance_methods.include? 'will_paginate'
|
11
|
+
require 'good_sort/will_paginate'
|
12
|
+
ActionView::Base.send :include, WillPaginate
|
13
|
+
end
|
9
14
|
end
|
10
15
|
end
|
11
16
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: JasonKing-good_sort
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason King
|
@@ -28,6 +28,7 @@ files:
|
|
28
28
|
- lib/good_sort
|
29
29
|
- lib/good_sort/sorter.rb
|
30
30
|
- lib/good_sort/view_helpers.rb
|
31
|
+
- lib/good_sort/will_paginate.rb
|
31
32
|
- lib/good_sort.rb
|
32
33
|
- test/good_sort_test.rb
|
33
34
|
- test/good_sort_view.rb
|