Skip to content

N+1 issues #736

@cw6365

Description

@cw6365

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions