From e4b73281742be5f84de95af305922f464bfcef2c Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Thu, 6 Aug 2020 23:12:19 -0500 Subject: [PATCH] Added onlyVerified for searching account.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added: - onlyVerified for searching account.rb • Todo: - fully implement --- app/models/account.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/models/account.rb b/app/models/account.rb index 315f0453..6f31615c 100644 --- a/app/models/account.rb +++ b/app/models/account.rb @@ -405,8 +405,9 @@ class Account < ApplicationRecord DeliveryFailureTracker.filter(urls) end - def search_for(terms, limit = 10, offset = 0) + def search_for(terms, limit = 10, offset = 0, options = {}) textsearch, query = generate_query_for_search(terms) + @onlyVerified = options[:onlyVerified] || false sql = <<-SQL.squish SELECT @@ -426,8 +427,9 @@ class Account < ApplicationRecord records end - def advanced_search_for(terms, account, limit = 10, following = false, offset = 0) + def advanced_search_for(terms, account, limit = 10, following = false, offset = 0, options = {}) textsearch, query = generate_query_for_search(terms) + @onlyVerified = options[:onlyVerified] || false sql = <<-SQL.squish SELECT