Clean up a bit as per #1013 with TODO comments

This commit is contained in:
Daniel O'Connor committed 2016-07-08 17:06:05 +09:30
1 parent efd112c4b8
commit 6b059cb4f4
1 file changed
+9 -1
+9 -1
View File
@@ -83,8 +83,16 @@ class CropsController < ApplicationController
respond_to do |format|
format.html # show.html.haml
format.json do
# TODO RABL or similar one day to avoid presentation logic here
owner_structure = {
owner: {
only: [:id, :login_name, :location, :latitude, :longitude]
}
}
render json: @crop.to_json(include: {
plantings: { include: { owner: { only: [:id, :login_name, :location, :latitude, :longitude] }}}
plantings: {
include: owner_structure
}
})
end
end