Routable: Verify the amount of SQL queries created for full_name and full_path
The following discussion from !112702 (merged) should be addressed:
-
@splattael started a discussion: (+2 comments) Observation (non-blocking) Not this MR but it seems we are loading the
route
association here already and only check forroute_loaded?
in the line below.pry(main)> p = Project.find(1); nil Project Load (0.6ms) SELECT "projects".* FROM "projects" WHERE "projects"."id" = 1 LIMIT 1 /*application:console,db_config_name:main,console_hostname:happy,console_username:peter,line:(pry):75:in `__pry__'*/ => nil pry(main)> p.association(:route).loaded? => false pry(main)> p.route.nil? Route Load (1.0ms) SELECT "routes".* FROM "routes" WHERE "routes"."source_id" = 1 AND "routes"."source_type" = 'Project' LIMIT 1 /*application:console,db_config_name:main,console_hostname:happy,console_username:peter,line:(pry):77:in `__pry__'*/ => false pry(main)> p.association(:route).loaded? => true
I wonder if the two lines should be swapped?
🤔 /cc @robotmay_gitlab