Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #148 from lest/fix-respond-to

accept second argument in Search#respond_to?
  • Loading branch information...
commit b36951ac582ce4e9b4fdacac98ecbc05caf3f51c 2 parents 48bb635 + 375a139
@ernie ernie authored
Showing with 8 additions and 2 deletions.
  1. +2 −2 lib/ransack/search.rb
  2. +6 −0 spec/ransack/search_spec.rb
View
4 lib/ransack/search.rb
@@ -72,7 +72,7 @@ def new_sort(opts = {})
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 @@ def collapse_multiparameter_attributes!(attrs)
end
end
-end
+end
View
6 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
Please sign in to comment.
Something went wrong with that request. Please try again.