@@ -39,12 +39,10 @@ defmodule Ecto.Repo.Preloader do
39
39
end
40
40
41
41
def preload ( structs , repo_name , preloads , opts ) when is_list ( structs ) do
42
- # IO.inspect([preloads: preloads, opts: opts], label: :preload__list)
43
42
normalize_and_preload_each ( structs , repo_name , preloads , opts [ :take ] , opts )
44
43
end
45
44
46
45
def preload ( struct , repo_name , preloads , opts ) when is_map ( struct ) do
47
- # IO.inspect([preloads: preloads, opts: opts], label: :preload__map)
48
46
normalize_and_preload_each ( [ struct ] , repo_name , preloads , opts [ :take ] , opts ) |> hd ( )
49
47
end
50
48
@@ -110,7 +108,6 @@ defmodule Ecto.Repo.Preloader do
110
108
[
111
109
fn opts ->
112
110
fetch_query ( fetch_ids , assoc , repo_name , query , prefix , related_key , take , opts )
113
- # |> IO.inspect(label: :fetch_query)
114
111
end
115
112
| queries
116
113
]
@@ -193,7 +190,6 @@ defmodule Ecto.Repo.Preloader do
193
190
"""
194
191
end
195
192
196
- binding ( ) |> Keyword . take ( ~w/ ids loaded? struct value field owner_key card/ a ) |> IO . inspect ( label: :fetch_ids )
197
193
cond do
198
194
card == :one and loaded? ->
199
195
{ fetch_ids , [ ids | loaded_ids ] , [ value | loaded_structs ] }
@@ -208,7 +204,6 @@ defmodule Ecto.Repo.Preloader do
208
204
end
209
205
210
206
defp fetch_query ( ids , assoc , _repo_name , query , _prefix , related_key , _take , _opts ) when is_function ( query , 1 ) do
211
- binding ( ) |> Keyword . take ( ~w( query ids related_key) a ) |> IO . inspect ( label: :fetch_query_first )
212
207
# Note we use an explicit sort because we don't want
213
208
# to reorder based on the struct. Only the ID.
214
209
ids
@@ -228,7 +223,6 @@ defmodule Ecto.Repo.Preloader do
228
223
229
224
# Add the related key to the query results
230
225
query = update_in query . select . expr , & { :{} , [ ] , [ fields , & 1 ] }
231
- binding ( ) |> Keyword . take ( ~w( fields query ids related_key take) a ) |> IO . inspect ( label: :fetch_query_second )
232
226
233
227
# If we are returning many results, we must sort by the key too
234
228
query =
@@ -370,7 +364,6 @@ defmodule Ecto.Repo.Preloader do
370
364
371
365
defp load_assoc ( { :assoc , assoc , ids } , struct ) do
372
366
% { field: field , owner_key: owner_key , cardinality: cardinality } = assoc
373
- binding ( ) |> Keyword . take ( ~w( struct ids owner_key) a ) |> IO . inspect ( label: :load_assoc )
374
367
Enum . reduce owner_key , struct , fn owner_key_field , struct ->
375
368
key = Map . fetch! ( struct , owner_key_field )
376
369
0 commit comments