Skip to content

Commit

Permalink
Merge pull request codeforamerica#8 from fullstacklabs/uniq
Browse files Browse the repository at this point in the history
Ensure that return is uniq
  • Loading branch information
superkat64 authored Oct 4, 2017
2 parents f4b4a5c + 085e449 commit 7a02adb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/categories_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Api
module V1
class CategoriesController < ApplicationController
def index
categories = Category.all
categories = Category.all.arrange_serializable
render json: categories, status: 200
end

Expand Down
2 changes: 1 addition & 1 deletion app/controllers/api/v1/search_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def index
return unless stale?(etag: cache_key(locations), public: true)

generate_pagination_headers(locations)
render json: locations.preload(tables), each_serializer: LocationsSerializer, status: 200
render json: locations.uniq.preload(tables), each_serializer: LocationsSerializer, status: 200
end

def nearby
Expand Down

0 comments on commit 7a02adb

Please sign in to comment.