mirror of
https://github.com/activerecord-hackery/ransack.git
synced 2022-11-09 13:47:45 -05:00
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
2 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue