diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-02-22 09:10:32 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-02-23 09:31:57 -0600 |
commit | 5c7f9d69e3db27921acf6d8259245f2b4babcc2b (patch) | |
tree | b90334ce234ddd3921e0f1780cf3bb0848adff7b /app/models/concerns/case_sensitivity.rb | |
parent | 02494f7ce86fbf1276b384f45f58558c427eff63 (diff) | |
download | gitlab-ce-5c7f9d69e3db27921acf6d8259245f2b4babcc2b.tar.gz |
Fix code for cops
Diffstat (limited to 'app/models/concerns/case_sensitivity.rb')
-rw-r--r-- | app/models/concerns/case_sensitivity.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/app/models/concerns/case_sensitivity.rb b/app/models/concerns/case_sensitivity.rb index 2cfb6127c96..034e9f40ff0 100644 --- a/app/models/concerns/case_sensitivity.rb +++ b/app/models/concerns/case_sensitivity.rb @@ -13,11 +13,12 @@ module CaseSensitivity params.each do |key, value| column = ActiveRecord::Base.connection.quote_table_name(key) - condition = if cast_lower - "LOWER(#{column}) = LOWER(:value)" - else - "#{column} = :value" - end + condition = + if cast_lower + "LOWER(#{column}) = LOWER(:value)" + else + "#{column} = :value" + end criteria = criteria.where(condition, value: value) end |