diff --git a/app/models/account.rb b/app/models/account.rb index c4e54756728..c23549c22d9 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -138,10 +138,7 @@ class Account < ApplicationRecord scope :partitioned, -> { order(Arel.sql('row_number() over (partition by domain)')) } scope :without_instance_actor, -> { where.not(id: INSTANCE_ACTOR_ID) } scope :recent, -> { reorder(id: :desc) } - scope :bots, -> { where(actor_type: AUTOMATED_ACTOR_TYPES) } scope :non_automated, -> { where.not(actor_type: AUTOMATED_ACTOR_TYPES) } - scope :groups, -> { where(actor_type: 'Group') } - scope :alphabetic, -> { order(domain: :asc, username: :asc) } scope :matches_uri_prefix, ->(value) { where(arel_table[:uri].matches("#{sanitize_sql_like(value)}/%", false, true)).or(where(uri: value)) } scope :matches_username, ->(value) { where('lower((username)::text) LIKE lower(?)', "#{value}%") } scope :matches_display_name, ->(value) { where(arel_table[:display_name].matches("#{value}%")) } diff --git a/spec/models/account_spec.rb b/spec/models/account_spec.rb index 994a475dd9d..8ce337f1c74 100644 --- a/spec/models/account_spec.rb +++ b/spec/models/account_spec.rb @@ -640,19 +640,6 @@ RSpec.describe Account do end end - describe 'alphabetic' do - it 'sorts by alphabetic order of domain and username' do - matches = [ - { username: 'a', domain: 'a' }, - { username: 'b', domain: 'a' }, - { username: 'a', domain: 'b' }, - { username: 'b', domain: 'b' }, - ].map(&method(:Fabricate).curry(2).call(:account)) - - expect(described_class.without_internal.alphabetic).to eq matches - end - end - describe 'matches_display_name' do it 'matches display name which starts with the given string' do match = Fabricate(:account, display_name: 'pattern and suffix')