Skip to content

Commit 2045aac

Browse files
committed
Issue #1472 suggested fix
1 parent cc624b9 commit 2045aac

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ransack/search.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ def new_sort(opts = {})
102102
def method_missing(method_id, *args)
103103
method_name = method_id.to_s
104104
getter_name = method_name.sub(/=$/, ''.freeze)
105-
if base.attribute_method?(getter_name)
106-
base.send(method_id, *args)
107-
elsif @context.ransackable_scope?(getter_name, @context.object)
105+
if @context.ransackable_scope?(getter_name, @context.object)
108106
if method_name =~ /=$/
109107
add_scope getter_name, args
110108
else
111109
@scope_args[method_name]
112110
end
111+
elsif base.attribute_method?(getter_name)
112+
base.send(method_id, *args)
113113
else
114114
super
115115
end

0 commit comments

Comments
 (0)