Skip to content

Commit

Permalink
Remove unused and_reference from Image autocomplete.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjy committed Feb 6, 2025
1 parent bf22360 commit 2bb62ca
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions lib/queries/image/autocomplete.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,29 @@ def or_clauses
# a
end

# @return [Arel:Nodes, nil]
def and_clauses
return []
# clauses = [
# # valid_state,
# # is_type,
# # with_parent_id,
# # with_nomenclature_group
# ].compact
#
# return nil if clauses.nil?
#
# a = clauses.shift
# clauses.each do |b|
# a = a.and(b)
# end
# a
end
# # @return [Arel:Nodes, nil]
# def and_clauses
# return []
# # clauses = [
# # # valid_state,
# # # is_type,
# # # with_parent_id,
# # # with_nomenclature_group
# # ].compact
# #
# # return nil if clauses.nil?
# #
# # a = clauses.shift
# # clauses.each do |b|
# # a = a.and(b)
# # end
# # a
# end

# @return [Arel:Nodes]
def or_and
a = or_clauses
b = and_clauses
# b = and_clauses

if a && b
a.and(b)
Expand Down Expand Up @@ -76,7 +76,7 @@ def autocomplete
queries.each_with_index do |q,i|
a = q
a = q.where(project_id: project_id) if project_id.present?
a = a.where(and_clauses.to_sql) if and_clauses
# a = a.where(and_clauses.to_sql) unless and_clauses.blank?
updated_queries[i] = a
end

Expand Down

0 comments on commit 2bb62ca

Please sign in to comment.