diff --git a/lib/ransack/search.rb b/lib/ransack/search.rb index 3d88624..0560e10 100644 --- a/lib/ransack/search.rb +++ b/lib/ransack/search.rb @@ -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 \ No newline at end of file +end diff --git a/spec/ransack/search_spec.rb b/spec/ransack/search_spec.rb index 7a939fd..64c3ec0 100644 --- a/spec/ransack/search_spec.rb +++ b/spec/ransack/search_spec.rb @@ -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