Skip to content

Commit dcb57c5

Browse files
abMatGitscarroll32
andauthored
Issue #1472 suggested fix (#1474)
Co-authored-by: Sean <[email protected]> Co-authored-by: Sean <[email protected]>
1 parent ab5eaa4 commit dcb57c5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ransack/search.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,14 @@ def new_sort(opts = {})
103103
def method_missing(method_id, *args)
104104
method_name = method_id.to_s
105105
getter_name = method_name.sub(/=$/, ''.freeze)
106-
if base.attribute_method?(getter_name)
107-
base.send(method_id, *args)
108-
elsif @context.ransackable_scope?(getter_name, @context.object)
106+
if @context.ransackable_scope?(getter_name, @context.object)
109107
if method_name =~ /=$/
110108
add_scope getter_name, args
111109
else
112110
@scope_args[method_name]
113111
end
112+
elsif base.attribute_method?(getter_name)
113+
base.send(method_id, *args)
114114
else
115115
super
116116
end

0 commit comments

Comments
 (0)