avram
avram copied to clipboard
Preloads fail silently when given incorrect query
I gave a preload an incorrect query, in an ill-considered attempt to optimize:
preload_locations(LocationQuery.new.preload_url_path(URLPathQuery.new.limit(1))
The limit(1)
is incorrect, preload_locations
will retrieve more than one object. The result was an object with @_url_path_preloaded=true
, and @_preloaded_url_path=nil
, and no complaint from the preload code.