Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.90 KB | None | 0 0
  1. With pagy
  2.  
  3. => Booting Puma
  4. => Rails 6.0.2.1 application starting in development
  5. => Run `rails server --help` for more startup options
  6. Puma starting in single mode...
  7. * Version 4.3.1 (ruby 2.5.5-p157), codename: Mysterious Traveller
  8. * Min threads: 5, max threads: 5
  9. * Environment: development
  10. * Listening on tcp://127.0.0.1:3002
  11. * Listening on tcp://[::1]:3002
  12. Use Ctrl-C to stop
  13. Started GET "/api/v1/open_routes?date=2020-01-31" for ::1 at 2020-02-18 16:04:01 -0300
  14. Processing by Api::V1::RoutesController#index as JSON
  15. Parameters: {"date"=>"2020-01-31"}
  16. User Load (1.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]]
  17. (0.2ms) BEGIN
  18. User Update (0.7ms) UPDATE "users" SET "current_sign_in_at" = $1, "last_sign_in_at" = $2, "sign_in_count" = $3, "updated_at" = $4 WHERE "users"."id" = $5 [["current_sign_in_at", "2020-02-18 19:04:01.560705"], ["last_sign_in_at", "2020-02-18 19:03:43.270449"], ["sign_in_count", 115], ["updated_at", "2020-02-18 19:04:01.561851"], ["id", 3]]
  19. Account Load (0.8ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
  20. Account Update (1.6ms) UPDATE "accounts" SET "updated_at" = $1 WHERE "accounts"."id" = $2 [["updated_at", "2020-02-18 19:04:01.720955"], ["id", 1]]
  21. (2.2ms) COMMIT
  22. An enum element in Address uses the prefix 'not_'. This will cause a conflict with auto generated negative scopes.
  23. An enum element in Address uses the prefix 'not_'. This will cause a conflict with auto generated negative scopes.
  24. An enum element in Address uses the prefix 'not_'. This will cause a conflict with auto generated negative scopes.
  25. (23.7ms) SELECT COUNT(*) FROM (SELECT DISTINCT "routes"."id" FROM "routes" LEFT OUTER JOIN "trucks" ON "trucks"."id" = "routes"."truck_id" LEFT OUTER JOIN "truck_drivers" ON "truck_drivers"."truck_id" = "trucks"."id" LEFT OUTER JOIN "dispatches" ON "dispatches"."is_deleted" = $1 AND "dispatches"."route_id" = "routes"."id" LEFT OUTER JOIN "dispatch_guides" ON "dispatch_guides"."id" = "dispatches"."guide_id" AND "dispatch_guides"."active" = $2 LEFT OUTER JOIN "contacts" ON "contacts"."id" = "dispatch_guides"."contact_id" LEFT OUTER JOIN "addresses" ON "addresses"."id" = "dispatch_guides"."address_id" LEFT OUTER JOIN "addresses" "pickup_addresses_dispatch_guides" ON "pickup_addresses_dispatch_guides"."id" = "dispatch_guides"."pickup_address_id" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."model_id" = "dispatch_guides"."id" AND "custom_fields"."model_type" = $3 LEFT OUTER JOIN "custom_fields" "custom_fields_dispatch_guides_join" ON "custom_fields_dispatch_guides_join"."model_id" = "dispatch_guides"."id" AND "custom_fields_dispatch_guides_join"."model_type" = $4 LEFT OUTER JOIN "custom_field_types" ON "custom_field_types"."id" = "custom_fields_dispatch_guides_join"."custom_field_type_id" WHERE "routes"."account_id" = $5 AND "routes"."dispatch_date" BETWEEN $6 AND $7 AND "routes"."ended_at" IS NULL) subquery_for_count [["is_deleted", false], ["active", true], ["model_type", "DispatchGuide"], ["model_type", "DispatchGuide"], ["account_id", 1], ["dispatch_date", "2020-01-31"], ["dispatch_date", "2020-01-31"]]
  26. ↳ app/controllers/api/v1/routes_controller.rb:22:in `render_routes_json'
  27. CACHE (0.1ms) SELECT COUNT(*) FROM (SELECT DISTINCT "routes"."id" FROM "routes" LEFT OUTER JOIN "trucks" ON "trucks"."id" = "routes"."truck_id" LEFT OUTER JOIN "truck_drivers" ON "truck_drivers"."truck_id" = "trucks"."id" LEFT OUTER JOIN "dispatches" ON "dispatches"."is_deleted" = $1 AND "dispatches"."route_id" = "routes"."id" LEFT OUTER JOIN "dispatch_guides" ON "dispatch_guides"."id" = "dispatches"."guide_id" AND "dispatch_guides"."active" = $2 LEFT OUTER JOIN "contacts" ON "contacts"."id" = "dispatch_guides"."contact_id" LEFT OUTER JOIN "addresses" ON "addresses"."id" = "dispatch_guides"."address_id" LEFT OUTER JOIN "addresses" "pickup_addresses_dispatch_guides" ON "pickup_addresses_dispatch_guides"."id" = "dispatch_guides"."pickup_address_id" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."model_id" = "dispatch_guides"."id" AND "custom_fields"."model_type" = $3 LEFT OUTER JOIN "custom_fields" "custom_fields_dispatch_guides_join" ON "custom_fields_dispatch_guides_join"."model_id" = "dispatch_guides"."id" AND "custom_fields_dispatch_guides_join"."model_type" = $4 LEFT OUTER JOIN "custom_field_types" ON "custom_field_types"."id" = "custom_fields_dispatch_guides_join"."custom_field_type_id" WHERE "routes"."account_id" = $5 AND "routes"."dispatch_date" BETWEEN $6 AND $7 AND "routes"."ended_at" IS NULL) subquery_for_count [["is_deleted", false], ["active", true], ["model_type", "DispatchGuide"], ["model_type", "DispatchGuide"], ["account_id", 1], ["dispatch_date", "2020-01-31"], ["dispatch_date", "2020-01-31"]]
  28. ↳ app/controllers/api/v1/routes_controller.rb:23:in `render_routes_json'
  29. CACHE (0.0ms) SELECT COUNT(*) FROM (SELECT DISTINCT "routes"."id" FROM "routes" LEFT OUTER JOIN "trucks" ON "trucks"."id" = "routes"."truck_id" LEFT OUTER JOIN "truck_drivers" ON "truck_drivers"."truck_id" = "trucks"."id" LEFT OUTER JOIN "dispatches" ON "dispatches"."is_deleted" = $1 AND "dispatches"."route_id" = "routes"."id" LEFT OUTER JOIN "dispatch_guides" ON "dispatch_guides"."id" = "dispatches"."guide_id" AND "dispatch_guides"."active" = $2 LEFT OUTER JOIN "contacts" ON "contacts"."id" = "dispatch_guides"."contact_id" LEFT OUTER JOIN "addresses" ON "addresses"."id" = "dispatch_guides"."address_id" LEFT OUTER JOIN "addresses" "pickup_addresses_dispatch_guides" ON "pickup_addresses_dispatch_guides"."id" = "dispatch_guides"."pickup_address_id" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."model_id" = "dispatch_guides"."id" AND "custom_fields"."model_type" = $3 LEFT OUTER JOIN "custom_fields" "custom_fields_dispatch_guides_join" ON "custom_fields_dispatch_guides_join"."model_id" = "dispatch_guides"."id" AND "custom_fields_dispatch_guides_join"."model_type" = $4 LEFT OUTER JOIN "custom_field_types" ON "custom_field_types"."id" = "custom_fields_dispatch_guides_join"."custom_field_type_id" WHERE "routes"."account_id" = $5 AND "routes"."dispatch_date" BETWEEN $6 AND $7 AND "routes"."ended_at" IS NULL) subquery_for_count [["is_deleted", false], ["active", true], ["model_type", "DispatchGuide"], ["model_type", "DispatchGuide"], ["account_id", 1], ["dispatch_date", "2020-01-31"], ["dispatch_date", "2020-01-31"]]
  30. ↳ app/controllers/api/v1/routes_controller.rb:29:in `serialize_route'
  31. Unpermitted parameter: :format
  32. SQL (11.4ms) SELECT DISTINCT "routes"."id" FROM "routes" LEFT OUTER JOIN "trucks" ON "trucks"."id" = "routes"."truck_id" LEFT OUTER JOIN "truck_drivers" ON "truck_drivers"."truck_id" = "trucks"."id" LEFT OUTER JOIN "dispatches" ON "dispatches"."is_deleted" = $1 AND "dispatches"."route_id" = "routes"."id" LEFT OUTER JOIN "dispatch_guides" ON "dispatch_guides"."id" = "dispatches"."guide_id" AND "dispatch_guides"."active" = $2 LEFT OUTER JOIN "contacts" ON "contacts"."id" = "dispatch_guides"."contact_id" LEFT OUTER JOIN "addresses" ON "addresses"."id" = "dispatch_guides"."address_id" LEFT OUTER JOIN "addresses" "pickup_addresses_dispatch_guides" ON "pickup_addresses_dispatch_guides"."id" = "dispatch_guides"."pickup_address_id" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."model_id" = "dispatch_guides"."id" AND "custom_fields"."model_type" = $3 LEFT OUTER JOIN "custom_fields" "custom_fields_dispatch_guides_join" ON "custom_fields_dispatch_guides_join"."model_id" = "dispatch_guides"."id" AND "custom_fields_dispatch_guides_join"."model_type" = $4 LEFT OUTER JOIN "custom_field_types" ON "custom_field_types"."id" = "custom_fields_dispatch_guides_join"."custom_field_type_id" WHERE "routes"."account_id" = $5 AND "routes"."dispatch_date" BETWEEN $6 AND $7 AND "routes"."ended_at" IS NULL LIMIT $8 OFFSET $9 [["is_deleted", false], ["active", true], ["model_type", "DispatchGuide"], ["model_type", "DispatchGuide"], ["account_id", 1], ["dispatch_date", "2020-01-31"], ["dispatch_date", "2020-01-31"], ["LIMIT", 10], ["OFFSET", 0]]
  33. ↳ app/controllers/api/v1/routes_controller.rb:37:in `serialize_route'
  34. SQL (10.8ms) SELECT "routes"."id" AS t0_r0, "routes"."truck_id" AS t0_r1, "routes"."active" AS t0_r2, "routes"."dispatch_date" AS t0_r3, "routes"."start_time" AS t0_r4, "routes"."minutes_between" AS t0_r5, "routes"."end_time" AS t0_r6, "routes"."started_at" AS t0_r7, "routes"."ended" AS t0_r8, "routes"."ended_at" AS t0_r9, "routes"."truck_driver_id" AS t0_r10, "routes"."kpi_distance" AS t0_r11, "routes"."kpi_max_speed" AS t0_r12, "routes"."kpi_avg_speed" AS t0_r13, "routes"."kpi_time" AS t0_r14, "routes"."kpi_stop_time" AS t0_r15, "routes"."account_id" AS t0_r16, "routes"."enable_estimations" AS t0_r17, "routes"."encoded_optimal_path" AS t0_r18, "routes"."start_in_place" AS t0_r19, "routes"."initial_dispatches_order" AS t0_r20, "routes"."planned_distance" AS t0_r21, "routes"."real_distance" AS t0_r22, "routes"."created_at" AS t0_r23, "routes"."updated_at" AS t0_r24, "trucks"."id" AS t1_r0, "trucks"."identifier" AS t1_r1, "trucks"."is_ramp" AS t1_r2, "trucks"."active" AS t1_r3, "trucks"."has_own_gps" AS t1_r4, "trucks"."vehicle_type" AS t1_r5, "trucks"."capacity" AS t1_r6, "trucks"."account_id" AS t1_r7, "trucks"."created_at" AS t1_r8, "trucks"."updated_at" AS t1_r9, "truck_drivers"."id" AS t2_r0, "truck_drivers"."name" AS t2_r1, "truck_drivers"."username" AS t2_r2, "truck_drivers"."truck_id" AS t2_r3, "truck_drivers"."telephone" AS t2_r4, "truck_drivers"."pin_code" AS t2_r5, "truck_drivers"."unique_hash" AS t2_r6, "truck_drivers"."active" AS t2_r7, "truck_drivers"."app_version" AS t2_r8, "truck_drivers"."account_id" AS t2_r9, "truck_drivers"."device_name" AS t2_r10, "truck_drivers"."os_version" AS t2_r11, "truck_drivers"."picture_approved" AS t2_r12, "truck_drivers"."picture" AS t2_r13, "truck_drivers"."created_at" AS t2_r14, "truck_drivers"."updated_at" AS t2_r15, "dispatches"."id" AS t3_r0, "dispatches"."account_id" AS t3_r1, "dispatches"."guide_id" AS t3_r2, "dispatches"."route_id" AS t3_r3, "dispatches"."status_id" AS t3_r4, "dispatches"."estimated_at" AS t3_r5, "dispatches"."arrived_at" AS t3_r6, "dispatches"."slot" AS t3_r7, "dispatches"."has_form" AS t3_r8, "dispatches"."is_trunk" AS t3_r9, "dispatches"."is_pickup" AS t3_r10, "dispatches"."end_type" AS t3_r11, "dispatches"."delivery_time" AS t3_r12, "dispatches"."is_deleted" AS t3_r13, "dispatches"."load" AS t3_r14, "dispatches"."priority" AS t3_r15, "dispatches"."delivered_in_client" AS t3_r16, "dispatches"."created_at" AS t3_r17, "dispatches"."updated_at" AS t3_r18, "dispatch_guides"."id" AS t4_r0, "dispatch_guides"."account_id" AS t4_r1, "dispatch_guides"."code" AS t4_r2, "dispatch_guides"."dispatches_count" AS t4_r3, "dispatch_guides"."place_id" AS t4_r4, "dispatch_guides"."first_estimated" AS t4_r5, "dispatch_guides"."service_time" AS t4_r6, "dispatch_guides"."min_delivery_time" AS t4_r7, "dispatch_guides"."max_delivery_time" AS t4_r8, "dispatch_guides"."beecode" AS t4_r9, "dispatch_guides"."active" AS t4_r10, "dispatch_guides"."mode" AS t4_r11, "dispatch_guides"."created_at" AS t4_r12, "dispatch_guides"."updated_at" AS t4_r13, "dispatch_guides"."contact_id" AS t4_r14, "dispatch_guides"."address_id" AS t4_r15, "dispatch_guides"."pickup_address_id" AS t4_r16, "contacts"."id" AS t5_r0, "contacts"."account_id" AS t5_r1, "contacts"."email" AS t5_r2, "contacts"."phone" AS t5_r3, "contacts"."identifier" AS t5_r4, "contacts"."name" AS t5_r5, "contacts"."contact_type" AS t5_r6, "contacts"."last_sent_survey" AS t5_r7, "contacts"."created_at" AS t5_r8, "contacts"."updated_at" AS t5_r9, "addresses"."id" AS t6_r0, "addresses"."account_id" AS t6_r1, "addresses"."name" AS t6_r2, "addresses"."name_correct" AS t6_r3, "addresses"."city" AS t6_r4, "addresses"."state" AS t6_r5, "addresses"."postal_code" AS t6_r6, "addresses"."latitude" AS t6_r7, "addresses"."latitude_proposed" AS t6_r8, "addresses"."longitude" AS t6_r9, "addresses"."longitude_proposed" AS t6_r10, "addresses"."country" AS t6_r11, "addresses"."geocoding_status" AS t6_r12, "addresses"."created_at" AS t6_r13, "addresses"."updated_at" AS t6_r14, "pickup_addresses_dispatch_guides"."id" AS t7_r0, "pickup_addresses_dispatch_guides"."account_id" AS t7_r1, "pickup_addresses_dispatch_guides"."name" AS t7_r2, "pickup_addresses_dispatch_guides"."name_correct" AS t7_r3, "pickup_addresses_dispatch_guides"."city" AS t7_r4, "pickup_addresses_dispatch_guides"."state" AS t7_r5, "pickup_addresses_dispatch_guides"."postal_code" AS t7_r6, "pickup_addresses_dispatch_guides"."latitude" AS t7_r7, "pickup_addresses_dispatch_guides"."latitude_proposed" AS t7_r8, "pickup_addresses_dispatch_guides"."longitude" AS t7_r9, "pickup_addresses_dispatch_guides"."longitude_proposed" AS t7_r10, "pickup_addresses_dispatch_guides"."country" AS t7_r11, "pickup_addresses_dispatch_guides"."geocoding_status" AS t7_r12, "pickup_addresses_dispatch_guides"."created_at" AS t7_r13, "pickup_addresses_dispatch_guides"."updated_at" AS t7_r14, "custom_fields"."id" AS t8_r0, "custom_fields"."custom_field_type_id" AS t8_r1, "custom_fields"."account_id" AS t8_r2, "custom_fields"."model_id" AS t8_r3, "custom_fields"."model_type" AS t8_r4, "custom_fields"."value" AS t8_r5, "custom_fields"."created_at" AS t8_r6, "custom_fields"."updated_at" AS t8_r7, "custom_field_types"."id" AS t9_r0, "custom_field_types"."account_id" AS t9_r1, "custom_field_types"."name" AS t9_r2, "custom_field_types"."model_type" AS t9_r3, "custom_field_types"."show_in_web" AS t9_r4, "custom_field_types"."show_in_mobile" AS t9_r5, "custom_field_types"."has_many_flag" AS t9_r6, "custom_field_types"."created_at" AS t9_r7, "custom_field_types"."updated_at" AS t9_r8 FROM "routes" LEFT OUTER JOIN "trucks" ON "trucks"."id" = "routes"."truck_id" LEFT OUTER JOIN "truck_drivers" ON "truck_drivers"."truck_id" = "trucks"."id" LEFT OUTER JOIN "dispatches" ON "dispatches"."is_deleted" = $1 AND "dispatches"."route_id" = "routes"."id" LEFT OUTER JOIN "dispatch_guides" ON "dispatch_guides"."id" = "dispatches"."guide_id" AND "dispatch_guides"."active" = $2 LEFT OUTER JOIN "contacts" ON "contacts"."id" = "dispatch_guides"."contact_id" LEFT OUTER JOIN "addresses" ON "addresses"."id" = "dispatch_guides"."address_id" LEFT OUTER JOIN "addresses" "pickup_addresses_dispatch_guides" ON "pickup_addresses_dispatch_guides"."id" = "dispatch_guides"."pickup_address_id" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."model_id" = "dispatch_guides"."id" AND "custom_fields"."model_type" = $3 LEFT OUTER JOIN "custom_fields" "custom_fields_dispatch_guides_join" ON "custom_fields_dispatch_guides_join"."model_id" = "dispatch_guides"."id" AND "custom_fields_dispatch_guides_join"."model_type" = $4 LEFT OUTER JOIN "custom_field_types" ON "custom_field_types"."id" = "custom_fields_dispatch_guides_join"."custom_field_type_id" WHERE "routes"."account_id" = $5 AND "routes"."dispatch_date" BETWEEN $6 AND $7 AND "routes"."ended_at" IS NULL AND "routes"."id" IN ($8, $9, $10, $11, $12, $13, $14, $15, $16, $17) [["is_deleted", false], ["active", true], ["model_type", "DispatchGuide"], ["model_type", "DispatchGuide"], ["account_id", 1], ["dispatch_date", "2020-01-31"], ["dispatch_date", "2020-01-31"], ["id", 1], ["id", 2], ["id", 3], ["id", 4], ["id", 5], ["id", 6], ["id", 7], ["id", 8], ["id", 9], ["id", 10]]
  35. ↳ app/controllers/api/v1/routes_controller.rb:37:in `serialize_route'
  36. Completed 200 OK in 807ms (Views: 0.4ms | ActiveRecord: 124.3ms | Allocations: 209998)
  37.  
  38.  
  39. //
  40.  
  41. Without Pagy
  42.  
  43. => Booting Puma
  44. => Rails 6.0.2.1 application starting in development
  45. => Run `rails server --help` for more startup options
  46. Puma starting in single mode...
  47. * Version 4.3.1 (ruby 2.5.5-p157), codename: Mysterious Traveller
  48. * Min threads: 5, max threads: 5
  49. * Environment: development
  50. * Listening on tcp://127.0.0.1:3002
  51. * Listening on tcp://[::1]:3002
  52. Use Ctrl-C to stop
  53. Started GET "/api/v1/open_routes?date=2020-01-31" for ::1 at 2020-02-18 16:05:19 -0300
  54. Processing by Api::V1::RoutesController#index as JSON
  55. Parameters: {"date"=>"2020-01-31"}
  56. User Load (1.3ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 3], ["LIMIT", 1]]
  57. (0.3ms) BEGIN
  58. User Update (6.5ms) UPDATE "users" SET "current_sign_in_at" = $1, "last_sign_in_at" = $2, "sign_in_count" = $3, "updated_at" = $4 WHERE "users"."id" = $5 [["current_sign_in_at", "2020-02-18 19:05:19.245360"], ["last_sign_in_at", "2020-02-18 19:04:01.560705"], ["sign_in_count", 116], ["updated_at", "2020-02-18 19:05:19.253536"], ["id", 3]]
  59. Account Load (0.5ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]]
  60. Account Update (0.5ms) UPDATE "accounts" SET "updated_at" = $1 WHERE "accounts"."id" = $2 [["updated_at", "2020-02-18 19:05:19.353177"], ["id", 1]]
  61. (1.5ms) COMMIT
  62. An enum element in Address uses the prefix 'not_'. This will cause a conflict with auto generated negative scopes.
  63. An enum element in Address uses the prefix 'not_'. This will cause a conflict with auto generated negative scopes.
  64. An enum element in Address uses the prefix 'not_'. This will cause a conflict with auto generated negative scopes.
  65. (30.4ms) SELECT COUNT(*) FROM (SELECT DISTINCT "routes"."id" FROM "routes" LEFT OUTER JOIN "trucks" ON "trucks"."id" = "routes"."truck_id" LEFT OUTER JOIN "truck_drivers" ON "truck_drivers"."truck_id" = "trucks"."id" LEFT OUTER JOIN "dispatches" ON "dispatches"."is_deleted" = $1 AND "dispatches"."route_id" = "routes"."id" LEFT OUTER JOIN "dispatch_guides" ON "dispatch_guides"."id" = "dispatches"."guide_id" AND "dispatch_guides"."active" = $2 LEFT OUTER JOIN "contacts" ON "contacts"."id" = "dispatch_guides"."contact_id" LEFT OUTER JOIN "addresses" ON "addresses"."id" = "dispatch_guides"."address_id" LEFT OUTER JOIN "addresses" "pickup_addresses_dispatch_guides" ON "pickup_addresses_dispatch_guides"."id" = "dispatch_guides"."pickup_address_id" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."model_id" = "dispatch_guides"."id" AND "custom_fields"."model_type" = $3 LEFT OUTER JOIN "custom_fields" "custom_fields_dispatch_guides_join" ON "custom_fields_dispatch_guides_join"."model_id" = "dispatch_guides"."id" AND "custom_fields_dispatch_guides_join"."model_type" = $4 LEFT OUTER JOIN "custom_field_types" ON "custom_field_types"."id" = "custom_fields_dispatch_guides_join"."custom_field_type_id" WHERE "routes"."account_id" = $5 AND "routes"."dispatch_date" BETWEEN $6 AND $7 AND "routes"."ended_at" IS NULL) subquery_for_count [["is_deleted", false], ["active", true], ["model_type", "DispatchGuide"], ["model_type", "DispatchGuide"], ["account_id", 1], ["dispatch_date", "2020-01-31"], ["dispatch_date", "2020-01-31"]]
  66. ↳ app/controllers/api/v1/routes_controller.rb:22:in `render_routes_json'
  67. CACHE (0.0ms) SELECT COUNT(*) FROM (SELECT DISTINCT "routes"."id" FROM "routes" LEFT OUTER JOIN "trucks" ON "trucks"."id" = "routes"."truck_id" LEFT OUTER JOIN "truck_drivers" ON "truck_drivers"."truck_id" = "trucks"."id" LEFT OUTER JOIN "dispatches" ON "dispatches"."is_deleted" = $1 AND "dispatches"."route_id" = "routes"."id" LEFT OUTER JOIN "dispatch_guides" ON "dispatch_guides"."id" = "dispatches"."guide_id" AND "dispatch_guides"."active" = $2 LEFT OUTER JOIN "contacts" ON "contacts"."id" = "dispatch_guides"."contact_id" LEFT OUTER JOIN "addresses" ON "addresses"."id" = "dispatch_guides"."address_id" LEFT OUTER JOIN "addresses" "pickup_addresses_dispatch_guides" ON "pickup_addresses_dispatch_guides"."id" = "dispatch_guides"."pickup_address_id" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."model_id" = "dispatch_guides"."id" AND "custom_fields"."model_type" = $3 LEFT OUTER JOIN "custom_fields" "custom_fields_dispatch_guides_join" ON "custom_fields_dispatch_guides_join"."model_id" = "dispatch_guides"."id" AND "custom_fields_dispatch_guides_join"."model_type" = $4 LEFT OUTER JOIN "custom_field_types" ON "custom_field_types"."id" = "custom_fields_dispatch_guides_join"."custom_field_type_id" WHERE "routes"."account_id" = $5 AND "routes"."dispatch_date" BETWEEN $6 AND $7 AND "routes"."ended_at" IS NULL) subquery_for_count [["is_deleted", false], ["active", true], ["model_type", "DispatchGuide"], ["model_type", "DispatchGuide"], ["account_id", 1], ["dispatch_date", "2020-01-31"], ["dispatch_date", "2020-01-31"]]
  68. ↳ app/controllers/api/v1/routes_controller.rb:23:in `render_routes_json'
  69. Unpermitted parameter: :format
  70. SQL (8.0ms) SELECT DISTINCT "routes"."id" FROM "routes" LEFT OUTER JOIN "trucks" ON "trucks"."id" = "routes"."truck_id" LEFT OUTER JOIN "truck_drivers" ON "truck_drivers"."truck_id" = "trucks"."id" LEFT OUTER JOIN "dispatches" ON "dispatches"."is_deleted" = $1 AND "dispatches"."route_id" = "routes"."id" LEFT OUTER JOIN "dispatch_guides" ON "dispatch_guides"."id" = "dispatches"."guide_id" AND "dispatch_guides"."active" = $2 LEFT OUTER JOIN "contacts" ON "contacts"."id" = "dispatch_guides"."contact_id" LEFT OUTER JOIN "addresses" ON "addresses"."id" = "dispatch_guides"."address_id" LEFT OUTER JOIN "addresses" "pickup_addresses_dispatch_guides" ON "pickup_addresses_dispatch_guides"."id" = "dispatch_guides"."pickup_address_id" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."model_id" = "dispatch_guides"."id" AND "custom_fields"."model_type" = $3 LEFT OUTER JOIN "custom_fields" "custom_fields_dispatch_guides_join" ON "custom_fields_dispatch_guides_join"."model_id" = "dispatch_guides"."id" AND "custom_fields_dispatch_guides_join"."model_type" = $4 LEFT OUTER JOIN "custom_field_types" ON "custom_field_types"."id" = "custom_fields_dispatch_guides_join"."custom_field_type_id" WHERE "routes"."account_id" = $5 AND "routes"."dispatch_date" BETWEEN $6 AND $7 AND "routes"."ended_at" IS NULL LIMIT $8 OFFSET $9 [["is_deleted", false], ["active", true], ["model_type", "DispatchGuide"], ["model_type", "DispatchGuide"], ["account_id", 1], ["dispatch_date", "2020-01-31"], ["dispatch_date", "2020-01-31"], ["LIMIT", 10], ["OFFSET", 0]]
  71. ↳ app/controllers/api/v1/routes_controller.rb:37:in `serialize_route'
  72. SQL (7.3ms) SELECT "routes"."id" AS t0_r0, "routes"."truck_id" AS t0_r1, "routes"."active" AS t0_r2, "routes"."dispatch_date" AS t0_r3, "routes"."start_time" AS t0_r4, "routes"."minutes_between" AS t0_r5, "routes"."end_time" AS t0_r6, "routes"."started_at" AS t0_r7, "routes"."ended" AS t0_r8, "routes"."ended_at" AS t0_r9, "routes"."truck_driver_id" AS t0_r10, "routes"."kpi_distance" AS t0_r11, "routes"."kpi_max_speed" AS t0_r12, "routes"."kpi_avg_speed" AS t0_r13, "routes"."kpi_time" AS t0_r14, "routes"."kpi_stop_time" AS t0_r15, "routes"."account_id" AS t0_r16, "routes"."enable_estimations" AS t0_r17, "routes"."encoded_optimal_path" AS t0_r18, "routes"."start_in_place" AS t0_r19, "routes"."initial_dispatches_order" AS t0_r20, "routes"."planned_distance" AS t0_r21, "routes"."real_distance" AS t0_r22, "routes"."created_at" AS t0_r23, "routes"."updated_at" AS t0_r24, "trucks"."id" AS t1_r0, "trucks"."identifier" AS t1_r1, "trucks"."is_ramp" AS t1_r2, "trucks"."active" AS t1_r3, "trucks"."has_own_gps" AS t1_r4, "trucks"."vehicle_type" AS t1_r5, "trucks"."capacity" AS t1_r6, "trucks"."account_id" AS t1_r7, "trucks"."created_at" AS t1_r8, "trucks"."updated_at" AS t1_r9, "truck_drivers"."id" AS t2_r0, "truck_drivers"."name" AS t2_r1, "truck_drivers"."username" AS t2_r2, "truck_drivers"."truck_id" AS t2_r3, "truck_drivers"."telephone" AS t2_r4, "truck_drivers"."pin_code" AS t2_r5, "truck_drivers"."unique_hash" AS t2_r6, "truck_drivers"."active" AS t2_r7, "truck_drivers"."app_version" AS t2_r8, "truck_drivers"."account_id" AS t2_r9, "truck_drivers"."device_name" AS t2_r10, "truck_drivers"."os_version" AS t2_r11, "truck_drivers"."picture_approved" AS t2_r12, "truck_drivers"."picture" AS t2_r13, "truck_drivers"."created_at" AS t2_r14, "truck_drivers"."updated_at" AS t2_r15, "dispatches"."id" AS t3_r0, "dispatches"."account_id" AS t3_r1, "dispatches"."guide_id" AS t3_r2, "dispatches"."route_id" AS t3_r3, "dispatches"."status_id" AS t3_r4, "dispatches"."estimated_at" AS t3_r5, "dispatches"."arrived_at" AS t3_r6, "dispatches"."slot" AS t3_r7, "dispatches"."has_form" AS t3_r8, "dispatches"."is_trunk" AS t3_r9, "dispatches"."is_pickup" AS t3_r10, "dispatches"."end_type" AS t3_r11, "dispatches"."delivery_time" AS t3_r12, "dispatches"."is_deleted" AS t3_r13, "dispatches"."load" AS t3_r14, "dispatches"."priority" AS t3_r15, "dispatches"."delivered_in_client" AS t3_r16, "dispatches"."created_at" AS t3_r17, "dispatches"."updated_at" AS t3_r18, "dispatch_guides"."id" AS t4_r0, "dispatch_guides"."account_id" AS t4_r1, "dispatch_guides"."code" AS t4_r2, "dispatch_guides"."dispatches_count" AS t4_r3, "dispatch_guides"."place_id" AS t4_r4, "dispatch_guides"."first_estimated" AS t4_r5, "dispatch_guides"."service_time" AS t4_r6, "dispatch_guides"."min_delivery_time" AS t4_r7, "dispatch_guides"."max_delivery_time" AS t4_r8, "dispatch_guides"."beecode" AS t4_r9, "dispatch_guides"."active" AS t4_r10, "dispatch_guides"."mode" AS t4_r11, "dispatch_guides"."created_at" AS t4_r12, "dispatch_guides"."updated_at" AS t4_r13, "dispatch_guides"."contact_id" AS t4_r14, "dispatch_guides"."address_id" AS t4_r15, "dispatch_guides"."pickup_address_id" AS t4_r16, "contacts"."id" AS t5_r0, "contacts"."account_id" AS t5_r1, "contacts"."email" AS t5_r2, "contacts"."phone" AS t5_r3, "contacts"."identifier" AS t5_r4, "contacts"."name" AS t5_r5, "contacts"."contact_type" AS t5_r6, "contacts"."last_sent_survey" AS t5_r7, "contacts"."created_at" AS t5_r8, "contacts"."updated_at" AS t5_r9, "addresses"."id" AS t6_r0, "addresses"."account_id" AS t6_r1, "addresses"."name" AS t6_r2, "addresses"."name_correct" AS t6_r3, "addresses"."city" AS t6_r4, "addresses"."state" AS t6_r5, "addresses"."postal_code" AS t6_r6, "addresses"."latitude" AS t6_r7, "addresses"."latitude_proposed" AS t6_r8, "addresses"."longitude" AS t6_r9, "addresses"."longitude_proposed" AS t6_r10, "addresses"."country" AS t6_r11, "addresses"."geocoding_status" AS t6_r12, "addresses"."created_at" AS t6_r13, "addresses"."updated_at" AS t6_r14, "pickup_addresses_dispatch_guides"."id" AS t7_r0, "pickup_addresses_dispatch_guides"."account_id" AS t7_r1, "pickup_addresses_dispatch_guides"."name" AS t7_r2, "pickup_addresses_dispatch_guides"."name_correct" AS t7_r3, "pickup_addresses_dispatch_guides"."city" AS t7_r4, "pickup_addresses_dispatch_guides"."state" AS t7_r5, "pickup_addresses_dispatch_guides"."postal_code" AS t7_r6, "pickup_addresses_dispatch_guides"."latitude" AS t7_r7, "pickup_addresses_dispatch_guides"."latitude_proposed" AS t7_r8, "pickup_addresses_dispatch_guides"."longitude" AS t7_r9, "pickup_addresses_dispatch_guides"."longitude_proposed" AS t7_r10, "pickup_addresses_dispatch_guides"."country" AS t7_r11, "pickup_addresses_dispatch_guides"."geocoding_status" AS t7_r12, "pickup_addresses_dispatch_guides"."created_at" AS t7_r13, "pickup_addresses_dispatch_guides"."updated_at" AS t7_r14, "custom_fields"."id" AS t8_r0, "custom_fields"."custom_field_type_id" AS t8_r1, "custom_fields"."account_id" AS t8_r2, "custom_fields"."model_id" AS t8_r3, "custom_fields"."model_type" AS t8_r4, "custom_fields"."value" AS t8_r5, "custom_fields"."created_at" AS t8_r6, "custom_fields"."updated_at" AS t8_r7, "custom_field_types"."id" AS t9_r0, "custom_field_types"."account_id" AS t9_r1, "custom_field_types"."name" AS t9_r2, "custom_field_types"."model_type" AS t9_r3, "custom_field_types"."show_in_web" AS t9_r4, "custom_field_types"."show_in_mobile" AS t9_r5, "custom_field_types"."has_many_flag" AS t9_r6, "custom_field_types"."created_at" AS t9_r7, "custom_field_types"."updated_at" AS t9_r8 FROM "routes" LEFT OUTER JOIN "trucks" ON "trucks"."id" = "routes"."truck_id" LEFT OUTER JOIN "truck_drivers" ON "truck_drivers"."truck_id" = "trucks"."id" LEFT OUTER JOIN "dispatches" ON "dispatches"."is_deleted" = $1 AND "dispatches"."route_id" = "routes"."id" LEFT OUTER JOIN "dispatch_guides" ON "dispatch_guides"."id" = "dispatches"."guide_id" AND "dispatch_guides"."active" = $2 LEFT OUTER JOIN "contacts" ON "contacts"."id" = "dispatch_guides"."contact_id" LEFT OUTER JOIN "addresses" ON "addresses"."id" = "dispatch_guides"."address_id" LEFT OUTER JOIN "addresses" "pickup_addresses_dispatch_guides" ON "pickup_addresses_dispatch_guides"."id" = "dispatch_guides"."pickup_address_id" LEFT OUTER JOIN "custom_fields" ON "custom_fields"."model_id" = "dispatch_guides"."id" AND "custom_fields"."model_type" = $3 LEFT OUTER JOIN "custom_fields" "custom_fields_dispatch_guides_join" ON "custom_fields_dispatch_guides_join"."model_id" = "dispatch_guides"."id" AND "custom_fields_dispatch_guides_join"."model_type" = $4 LEFT OUTER JOIN "custom_field_types" ON "custom_field_types"."id" = "custom_fields_dispatch_guides_join"."custom_field_type_id" WHERE "routes"."account_id" = $5 AND "routes"."dispatch_date" BETWEEN $6 AND $7 AND "routes"."ended_at" IS NULL AND "routes"."id" IN ($8, $9, $10, $11, $12, $13, $14, $15, $16, $17) [["is_deleted", false], ["active", true], ["model_type", "DispatchGuide"], ["model_type", "DispatchGuide"], ["account_id", 1], ["dispatch_date", "2020-01-31"], ["dispatch_date", "2020-01-31"], ["id", 1], ["id", 2], ["id", 3], ["id", 4], ["id", 5], ["id", 6], ["id", 7], ["id", 8], ["id", 9], ["id", 10]]
  73. ↳ app/controllers/api/v1/routes_controller.rb:37:in `serialize_route'
  74. Completed 200 OK in 798ms (Views: 0.1ms | ActiveRecord: 111.9ms | Allocations: 208219)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement