Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N+1 issues #736

Open
cw6365 opened this issue Jun 9, 2020 · 1 comment
Open

N+1 issues #736

cw6365 opened this issue Jun 9, 2020 · 1 comment

Comments

@cw6365
Copy link

cw6365 commented Jun 9, 2020

I've got the following call in Rails 4

@obj = A.includes(B: { C: D}).find_by_uuid(params[:id])

Which works fine when viewing the SQL. The problem is the following RABL template creates multiple D database queries again. I'm using 0.14.0. This is the structure of my simplified Rabl.

show.rabl

object @obj
extends "documents/base"

base.rabl

child :B => :asb do |ab|
	object ab
	extends "shared/asb"
end

asb.rabl

child(:C => :csb) do
  	attributes :id 
  	child(:D => :dsb) do
  		 attributes :x, :y <<----------- multiple database calls
  	end
  end
@rbarrera87
Copy link

Did you find the solution for this @cw6365 ? I am facing the same issue I found this #142 (comment) but that is not working either.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants