Skip to content

Commit

Permalink
Issue activerecord-hackery#1472 suggested fix
Browse files Browse the repository at this point in the history
  • Loading branch information
abMatGit committed Jan 9, 2024
1 parent cc624b9 commit 2045aac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/ransack/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ def new_sort(opts = {})
def method_missing(method_id, *args)
method_name = method_id.to_s
getter_name = method_name.sub(/=$/, ''.freeze)
if base.attribute_method?(getter_name)
base.send(method_id, *args)
elsif @context.ransackable_scope?(getter_name, @context.object)
if @context.ransackable_scope?(getter_name, @context.object)
if method_name =~ /=$/
add_scope getter_name, args
else
@scope_args[method_name]
end
elsif base.attribute_method?(getter_name)
base.send(method_id, *args)
else
super
end
Expand Down

0 comments on commit 2045aac

Please sign in to comment.