Skip to content

Commit

Permalink
rename from has_name_or_key? to same_name_or_key?
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Sep 13, 2024
1 parent 8475772 commit d010162
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/ransack/nodes/condition.rb
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ def key
"_#{predicate.name}"
end

def has_name_or_key?(val)
def same_name_or_key?(val)
return false if val.nil?

val = val.to_s
Expand Down
4 changes: 2 additions & 2 deletions lib/ransack/nodes/grouping.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ def conditions=(conditions)
alias :c= :conditions=

def [](key)
conditions.detect { |c| c.has_name_or_key?(key) }
conditions.detect { |c| c.same_name_or_key?(key) }
end

def []=(key, value)
conditions.reject! { |c| c.has_name_or_key?(key) }
conditions.reject! { |c| c.same_name_or_key?(key) }
self.conditions << value
end

Expand Down

0 comments on commit d010162

Please sign in to comment.