Skip to content

Commit

Permalink
Add operator "==" that matches OR condition
Browse files Browse the repository at this point in the history
  • Loading branch information
tkusukawa committed May 20, 2017
1 parent 196f24b commit 4fc20ec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/redmine_wiki_lists/ref_issues/parser.rb
Expand Up @@ -212,6 +212,16 @@ def query.sql_for_field(field, operator, value, db_table, db_field, is_custom_fi
sql << ')'
return sql
end
elsif operator == '=='
sql = '('

value.each do |v|
sql << ' OR ' if sql != '('
sql << "LOWER(#{db_table}.#{db_field}) = '#{self.class.connection.quote_string(v.to_s.downcase)}'"
end

sql << ')'
return sql
elsif db_field == 'treated'
raise "- too many values for treated" if value.length > 2
raise "- too few values for treated" if value.length < 2
Expand Down

0 comments on commit 4fc20ec

Please sign in to comment.