accept second argument in Search#respond_to?

See http://ruby-doc.org/core-1.9.3/Object.html#method-i-respond_to-3F
This commit is contained in:
Sergey Nartimov 2012-10-11 15:43:40 +03:00
parent 48bb635eb1
commit 375a139c0e
2 changed files with 8 additions and 2 deletions

View File

@ -72,7 +72,7 @@ module Ransack
Nodes::Sort.new(@context).build(opts)
end
def respond_to?(method_id)
def respond_to?(method_id, include_private=false)
super or begin
method_name = method_id.to_s
writer = method_name.sub!(/\=$/, '')
@ -118,4 +118,4 @@ module Ransack
end
end
end
end

View File

@ -240,5 +240,11 @@ module Ransack
end
end
describe '#respond_to' do
it 'is aware of second argument' do
Search.new(Person).respond_to?(:name_eq, true).should be
end
end
end
end