summaryrefslogtreecommitdiff
path: root/app/controllers/api
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-11-22 22:13:39 -0700
committermo khan <mo@mokhan.ca>2014-11-22 22:13:39 -0700
commitc28c20f1b084a78b9d62253b29e3af1ca309c026 (patch)
tree8b1a5d5f162ab4e91c3cdcdd76f50f8ec09ca406 /app/controllers/api
parent8fd1049ab1881c54e7f89b7b229d5b692e8beb7c (diff)
fix select n+1
Diffstat (limited to 'app/controllers/api')
-rw-r--r--app/controllers/api/v2/cakes_controller.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/api/v2/cakes_controller.rb b/app/controllers/api/v2/cakes_controller.rb
index 48e17b87..ec38e753 100644
--- a/app/controllers/api/v2/cakes_controller.rb
+++ b/app/controllers/api/v2/cakes_controller.rb
@@ -7,7 +7,7 @@ module Api
end
def index
- @cakes = @repository.search_with(params).page(page).per(per_page)
+ @cakes = @repository.search_with(params).includes(:category).page(page).per(per_page)
end
def show(id = params[:id])