From 65e13cfacf0d1a862fbc4da44ad84b1522b01b34 Mon Sep 17 00:00:00 2001 From: ThibG Date: Mon, 4 Nov 2019 13:02:01 +0100 Subject: Add abilityto add oneself to lists (#12271) * Add ability to add oneself to lists * Change search results to include oneself when searching through followers * Mark follow relation as optional in ListAccount --- app/models/account.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/models/account.rb') diff --git a/app/models/account.rb b/app/models/account.rb index 05936def3..cae82da16 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -429,6 +429,8 @@ class Account < ApplicationRecord SELECT target_account_id FROM follows WHERE account_id = ? + UNION ALL + SELECT ? ) SELECT accounts.*, @@ -444,7 +446,7 @@ class Account < ApplicationRecord LIMIT ? OFFSET ? SQL - records = find_by_sql([sql, account.id, account.id, account.id, limit, offset]) + records = find_by_sql([sql, account.id, account.id, account.id, account.id, limit, offset]) else sql = <<-SQL.squish SELECT -- cgit