diff --git a/README.rdoc b/README.rdoc
index 9c2901a..11cd71a 100644
--- a/README.rdoc
+++ b/README.rdoc
@@ -62,10 +62,6 @@ Then bundle:
To show a lot more users per each page (change the +per_page+ value)
User.page(7).per(50)
Note that the +per+ scope is not directly defined on the models but is just a method defined on the page scope. This is absolutely reasonable because you will never actually use +per_page+ without specifying the +page+ number.
-
- If you would like to specify "no limit" while still using the +per+ scope, you can pass +nil+:
- User.count # => 1000
- User.page(1).per(nil).size # => 1000
Keep in mind that +per+ utilizes internally +limit+ and so it will override any +limit+ that was set previously
User.count # => 1000
diff --git a/lib/kaminari/models/page_scope_methods.rb b/lib/kaminari/models/page_scope_methods.rb
index b59cd59..b47134a 100644
--- a/lib/kaminari/models/page_scope_methods.rb
+++ b/lib/kaminari/models/page_scope_methods.rb
@@ -3,9 +3,7 @@ module Kaminari
# Specify the per_page value for the preceding page scope
# Model.page(3).per(10)
def per(num)
- if num.nil?
- limit(nil)
- elsif (n = num.to_i) <= 0
+ if (n = num.to_i) <= 0
self
elsif max_per_page && max_per_page < n
limit(max_per_page).offset(offset_value / limit_value * max_per_page)
diff --git a/spec/models/active_record/scopes_spec.rb b/spec/models/active_record/scopes_spec.rb
index c7f7b69..ea42d70 100644
--- a/spec/models/active_record/scopes_spec.rb
+++ b/spec/models/active_record/scopes_spec.rb
@@ -58,11 +58,6 @@ if defined? ActiveRecord
it { should have(5).users }
its('first.name') { should == 'user001' }
end
-
- context "page 1 per nil" do
- subject { model_class.page(1).per(nil) }
- it { should have(model_class.count).users }
- end
end
describe '#padding' do