Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
gab
social
gab-social
Commits
4fcae804
Commit
4fcae804
authored
Feb 20, 2021
by
azuregc7
Committed by
Free Speech Forever
Feb 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Feature/username search case
parent
1a7c3472
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
app/models/account.rb
app/models/account.rb
+2
-2
No files found.
app/models/account.rb
View file @
4fcae804
...
...
@@ -100,9 +100,9 @@ class Account < ApplicationRecord
scope
:bots
,
->
{
where
(
actor_type:
%w(Application Service)
)
}
scope
:alphabetic
,
->
{
order
(
domain: :asc
,
username: :asc
)
}
scope
:by_domain_accounts
,
->
{
group
(
:id
).
select
(
:domain
,
'COUNT(*) AS accounts_count'
).
order
(
'accounts_count desc'
)
}
scope
:matches_username
,
->
(
value
)
{
where
(
arel_table
[
:username
].
matches
(
"
#{
value
}
%"
))
}
scope
:matches_username
,
->
(
value
)
{
where
(
arel_table
[
:username
].
lower
.
matches
(
"
#{
value
.
downcase
}
%"
))
}
scope
:matches_display_name
,
->
(
value
)
{
where
(
arel_table
[
:display_name
].
matches
(
"
#{
value
}
%"
))
}
scope
:matches_domain
,
->
(
value
)
{
where
(
arel_table
[
:domain
].
matches
(
"%
#{
value
}
%"
))
}
scope
:matches_domain
,
->
(
value
)
{
where
(
arel_table
[
:domain
].
lower
.
matches
(
"%
#{
value
.
downcase
}
%"
))
}
scope
:searchable
,
->
{
without_suspended
.
where
(
moved_to_account_id:
nil
)
}
scope
:discoverable
,
->
{
searchable
.
without_silenced
.
where
(
discoverable:
true
).
joins
(
:account_stat
).
where
(
AccountStat
.
arel_table
[
:followers_count
].
gteq
(
MIN_FOLLOWERS_DISCOVERY
))
}
scope
:tagged_with
,
->
(
tag
)
{
joins
(
:accounts_tags
).
where
(
accounts_tags:
{
tag_id:
tag
})
}
...
...
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