FEATURE: increase search expansion to 50 results

refactor search code to deal with proper objects
use proper serializers, test the controllers
This commit is contained in:
Sam
2014-09-02 19:15:08 +10:00
parent b04a52676e
commit 4f09d552ed
13 changed files with 261 additions and 205 deletions

View File

@@ -0,0 +1,6 @@
class GroupedSearchResultSerializer < ApplicationSerializer
has_many :posts, serializer: SearchPostSerializer
has_many :users, serializer: BasicUserSerializer
has_many :categories, serializer: BasicCategorySerializer
attributes :more_posts, :more_users, :more_categories
end

View File

@@ -0,0 +1,9 @@
class SearchPostSerializer < PostSerializer
has_one :topic, serializer: ListableTopicSerializer
attributes :blurb
def blurb
options[:result].blurb(object)
end
end