Commit 7dd14855 authored by orozot's avatar orozot

Rename user search minimum char limit toggle

parent a4d04c0b
......@@ -717,14 +717,14 @@ class User < ApplicationRecord
.take(1) # at most 1 record as there is a unique constraint
where(
fuzzy_arel_match(:name, query, lower_exact_match: false, use_minimum_char_limit: use_minimum_char_limit_toggle)
.or(fuzzy_arel_match(:username, query, lower_exact_match: false, use_minimum_char_limit: use_minimum_char_limit_toggle))
fuzzy_arel_match(:name, query, use_minimum_char_limit: user_search_minimum_char_limit)
.or(fuzzy_arel_match(:username, query, use_minimum_char_limit: user_search_minimum_char_limit))
.or(arel_table[:email].eq(query))
.or(arel_table[:id].eq(matched_by_email_user_id))
)
end
def use_minimum_char_limit_toggle
def user_search_minimum_char_limit
true
end
......
......@@ -2538,9 +2538,9 @@ RSpec.describe User do
end
end
describe '.use_minimum_char_limit_toggle' do
describe '.user_search_minimum_char_limit' do
it 'returns true' do
expect(described_class.use_minimum_char_limit_toggle).to be true
expect(described_class.user_search_minimum_char_limit).to be true
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment