fix bug with empty string saved search categories
This commit is contained in:
@@ -823,8 +823,8 @@ class User < ActiveRecord::Base
|
|||||||
def unique_saved_search_categories
|
def unique_saved_search_categories
|
||||||
categories = saved_searches.pluck(:category)
|
categories = saved_searches.pluck(:category)
|
||||||
|
|
||||||
if categories.any? {|x| x.nil?}
|
if categories.any? {|x| x.blank?}
|
||||||
categories.compact!
|
categories.reject! {|x| x.blank?}
|
||||||
categories.unshift(SavedSearch::UNCATEGORIZED_NAME)
|
categories.unshift(SavedSearch::UNCATEGORIZED_NAME)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user