Progress on group account search
Added group member search, group removed account, album add styles
This commit is contained in:
@@ -404,7 +404,7 @@ class Account < ApplicationRecord
|
||||
records
|
||||
end
|
||||
|
||||
def advanced_search_for(terms, account, limit = 10, following = false, offset = 0, options = {})
|
||||
def advanced_search_for(terms, account, limit = 10, offset = 0, options = {})
|
||||
textsearch, query = generate_query_for_search(terms)
|
||||
@onlyVerified = options[:onlyVerified] || false
|
||||
|
||||
@@ -426,7 +426,6 @@ class Account < ApplicationRecord
|
||||
|
||||
records = find_by_sql([sql, account.id, account.id, limit, offset])
|
||||
|
||||
|
||||
ActiveRecord::Associations::Preloader.new.preload(records, :account_stat)
|
||||
records
|
||||
end
|
||||
|
||||
@@ -70,6 +70,16 @@ class Group < ApplicationRecord
|
||||
.limit(25)
|
||||
.offset(offset)
|
||||
end
|
||||
|
||||
def search_for_members(group, term, limit)
|
||||
pattern = '%' + sanitize_sql_like(term.strip) + '%'
|
||||
group.accounts.where("LOWER(username) LIKE LOWER(?)", pattern).limit(limit)
|
||||
end
|
||||
|
||||
def search_for_removed_accounts(group, term, limit)
|
||||
pattern = '%' + sanitize_sql_like(term.strip) + '%'
|
||||
group.removed_accounts.where("LOWER(username) LIKE LOWER(?)", pattern).limit(limit)
|
||||
end
|
||||
end
|
||||
|
||||
def has_password?
|
||||
|
||||
Reference in New Issue
Block a user