no need to log anything if term is blank

This commit is contained in:
Sam 2018-01-17 11:02:31 +11:00
parent 2f8a8dbb21
commit 2d2602edf0

View File

@ -36,6 +36,8 @@ class SearchLog < ActiveRecord::Base
def self.log(term:, search_type:, ip_address:, user_id: nil)
return [:error] if term.blank?
search_type = search_types[search_type]
return [:error] unless search_type.present? && ip_address.present?