include saved searches section in user profiles

This commit is contained in:
r888888888
2016-08-22 14:59:43 -07:00
parent 1eb335474c
commit d0bbe27217
4 changed files with 33 additions and 2 deletions

View File

@@ -106,7 +106,7 @@ class SavedSearch < ActiveRecord::Base
end
end
body.scan(/\d+/).map(&:to_i)
body.to_s.scan(/\d+/).map(&:to_i)
end
def normalize

View File

@@ -790,7 +790,14 @@ class User < ActiveRecord::Base
module SavedSearchMethods
def unique_saved_search_categories
[SavedSearch::UNCATEGORIZED_NAME] + saved_searches.pluck(:category).reject {|x| x.blank?}.uniq
categories = saved_searches.pluck(:category)
if categories.any? {|x| x.nil?}
categories.compact!
categories.unshift(SavedSearch::UNCATEGORIZED_NAME)
end
categories
end
end