diff --git a/lib/ransack/search.rb b/lib/ransack/search.rb index a8bf95f8..531133e2 100644 --- a/lib/ransack/search.rb +++ b/lib/ransack/search.rb @@ -99,6 +99,15 @@ def new_sort(opts = {}) Nodes::Sort.new(@context).build(opts) end + def respond_to_missing?(method_id, *args) + method_name = method_id.to_s + getter_name = method_name.sub(/=$/, ''.freeze) + return true if base.attribute_method?(getter_name) + return true if @context.ransackable_scope?(getter_name, @context.object) + + super + end + def method_missing(method_id, *args) method_name = method_id.to_s getter_name = method_name.sub(/=$/, ''.freeze)