Skip to content

Commit

Permalink
converting :page and :per_page into integers
Browse files Browse the repository at this point in the history
  • Loading branch information
mwmitchell committed Oct 3, 2009
1 parent 6939378 commit 3bd4c70
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require 'rake/gempackagetask'

spec = Gem::Specification.new do |s|
s.name = "rsolr-ext"
s.version = "0.9.6.3"
s.version = "0.9.6.4"
s.date = "2009-09-30"

s.summary = "An extension lib for RSolr"
Expand Down Expand Up @@ -38,7 +38,7 @@ spec = Gem::Specification.new do |s|

s.extra_rdoc_files = %w(LICENSE README.rdoc)

s.add_dependency("mwmitchell-rsolr", [">= 0.9.6"])
s.add_dependency("rsolr", [">= 0.9.6"])

end

Expand Down
2 changes: 1 addition & 1 deletion lib/rsolr-ext/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def map input
output[:rows] = input.delete(:per_page).to_i
end

if page = input.delete(:page).to_i
if page = input.delete(:page)
raise ':per_page must be set when using :page' unless output[:rows]
page = page.to_s.to_i-1
page = page < 1 ? 0 : page
Expand Down
4 changes: 2 additions & 2 deletions test/request_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ class RSolrExtRequestTest < Test::Unit::TestCase

test 'standard request' do
solr_params = RSolr::Ext::Request.map(
:page=>2,
:per_page=>10,
:page=>'2',
:per_page=>'10',
:phrases=>{:name=>'This is a phrase'},
:filters=>['test', {:price=>(1..10)}],
:phrase_filters=>{:manu=>['Apple']},
Expand Down

0 comments on commit 3bd4c70

Please sign in to comment.