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:
parent
48bb635eb1
commit
375a139c0e
|
@ -72,7 +72,7 @@ module Ransack
|
||||||
Nodes::Sort.new(@context).build(opts)
|
Nodes::Sort.new(@context).build(opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
def respond_to?(method_id)
|
def respond_to?(method_id, include_private=false)
|
||||||
super or begin
|
super or begin
|
||||||
method_name = method_id.to_s
|
method_name = method_id.to_s
|
||||||
writer = method_name.sub!(/\=$/, '')
|
writer = method_name.sub!(/\=$/, '')
|
||||||
|
@ -118,4 +118,4 @@ module Ransack
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -240,5 +240,11 @@ module Ransack
|
||||||
end
|
end
|
||||||
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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue