1
0
Fork 0
mirror of https://github.com/kaminari/kaminari.git synced 2022-11-09 13:44:37 -05:00

Revert "Also added support for blocks as well as procs and lambdas"

This reverts commit 55427d29be.

Reason: The test didn't pass.
This commit is contained in:
Akira Matsuda 2011-05-03 22:10:35 +09:00
parent fb52cbb065
commit 7f45b8ea21
2 changed files with 2 additions and 20 deletions

View file

@ -25,13 +25,7 @@ module Kaminari
config_accessor :param_name
def param_name
if block_given?
yield
elsif config.param_name.respond_to? :call
config.param_name.call()
else
config.param_name
end
config.param_name.respond_to?(:call) ? config.param_name.call() : config.param_name
end
end

View file

@ -46,19 +46,7 @@ describe Kaminari::Configuration do
its(:param_name) { should == :page }
end
context 'configured via block' do
before do
Kaminari.configure {|c| c.param_name { :test } }
end
its(:param_name) { should == :test }
after do
Kaminari.configure {|c| c.param_name = :page }
end
end
context 'configured via config lambda/proc' do
context 'configured via config block' do
before do
Kaminari.configure {|c| c.param_name = lambda { :test } }
end