Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7dd14855
Commit
7dd14855
authored
Dec 16, 2021
by
orozot
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename user search minimum char limit toggle
parent
a4d04c0b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
app/models/user.rb
app/models/user.rb
+3
-3
spec/models/user_spec.rb
spec/models/user_spec.rb
+2
-2
No files found.
app/models/user.rb
View file @
7dd14855
...
...
@@ -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
use
r_search_minimum_char_limit
true
end
...
...
spec/models/user_spec.rb
View file @
7dd14855
...
...
@@ -2538,9 +2538,9 @@ RSpec.describe User do
end
end
describe
'.use
_minimum_char_limit_toggle
'
do
describe
'.use
r_search_minimum_char_limit
'
do
it
'returns true'
do
expect
(
described_class
.
use
_minimum_char_limit_toggle
).
to
be
true
expect
(
described_class
.
use
r_search_minimum_char_limit
).
to
be
true
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment