sunspot_with_kaminari 0.1.1 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2011 Richard Millan
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -8,7 +8,7 @@ on `Gemfile`
8
8
 
9
9
  gem 'kaminari'
10
10
  gem "sunspot_rails"
11
- gem "sunspot_with_kaminari", '~> 0.1'
11
+ gem "sunspot_with_kaminari", '~> 0.2.0'
12
12
 
13
13
  on the controller
14
14
 
@@ -1,3 +1,5 @@
1
+ require 'sunspot'
2
+
1
3
  module SunspotWithKaminari
2
4
  module Search
3
5
  module AbstractSearchInstanceMethods
@@ -22,7 +24,7 @@ module SunspotWithKaminari
22
24
  # Integer:: Number of records displayed per page
23
25
  #
24
26
  def limit_value
25
- @query.per_page
27
+ @query.per_page || Kaminari.config.default_per_page
26
28
  end
27
29
 
28
30
  def empty?
@@ -32,6 +34,11 @@ module SunspotWithKaminari
32
34
  def any?
33
35
  total > 0
34
36
  end
37
+
38
+ def page(current_page)
39
+ query.paginate(current_page, nil)
40
+ self.execute.results
41
+ end
35
42
  end
36
43
  end
37
44
  end
@@ -1,3 +1,3 @@
1
1
  module SunspotWithKaminari
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -14,6 +14,7 @@ Gem::Specification.new do |s|
14
14
 
15
15
  s.rubyforge_project = "sunspot_with_kaminari"
16
16
 
17
+ s.add_dependency 'sunspot'
17
18
  s.add_dependency 'sunspot_rails'
18
19
  s.add_dependency 'kaminari', '>= 0.14.0'
19
20
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunspot_with_kaminari
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,8 +9,24 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-29 00:00:00.000000000 Z
12
+ date: 2013-01-09 00:00:00.000000000 Z
13
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: sunspot
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
14
30
  - !ruby/object:Gem::Dependency
15
31
  name: sunspot_rails
16
32
  requirement: !ruby/object:Gem::Requirement
@@ -52,6 +68,7 @@ extra_rdoc_files: []
52
68
  files:
53
69
  - .gitignore
54
70
  - Gemfile
71
+ - LICENSE.txt
55
72
  - README.md
56
73
  - Rakefile
57
74
  - lib/sunspot_with_kaminari.rb