Skip to content

Commit 2d2c0dd

Browse files
authored
Revert "Issue #1472 suggested fix (#1474)" (#1619)
This reverts commit dcb57c5.
1 parent fbec0ef commit 2d2c0dd

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 @context.ransackable_scope?(getter_name, @context.object)
106+
if base.attribute_method?(getter_name)
107+
base.send(method_id, *args)
108+
elsif @context.ransackable_scope?(getter_name, @context.object)
107109
if method_name =~ /=$/
108110
add_scope getter_name, args
109111
else
110112
@scope_args[method_name]
111113
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)