indrajit_alex

Nil value

Sep 9th, 2025
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 4.91 KB | None | 0 0
  1. app(prod)> t = TargetUser.first!
  2. {"host":"ip-10-100-6-116.ap-northeast-1.compute.internal","application":"Semantic Logger","environment":"production","timestamp":"2025-09-09T09:47:12.803831Z","level":"debug","level_index":1,"pid":3041,"thread":"1944","file":"(app)","line":1,"duration_ms":2.2459880001842976,"duration":"2.246ms","name":"ActiveRecord","message":"TargetUser Load","payload":{"sql":"SELECT `target_users`.* FROM `target_users` WHERE `target_users`.`deleted_at` IS NULL ORDER BY `target_users`.`id` ASC LIMIT 1","allocations":15,"cached":null}}
  3. =>
  4. #<TargetUser:0x0000ffff8689ae28
  5. ...
  6. app(prod)* cards = t.hundred_kcal_card_target_users.includes(hundred_kcal_card: :hundred_kcal_category).flat_map do |ctu|
  7. app(prod)*             Array.new(ctu.usage_count) { ctu.hundred_kcal_card }
  8. app(prod)>           end
  9. {"host":"ip-10-100-6-116.ap-northeast-1.compute.internal","application":"Semantic Logger","environment":"production","timestamp":"2025-09-09T09:47:46.703659Z","level":"debug","level_index":1,"pid":3041,"thread":"1944","file":"(app)","line":2,"duration_ms":2.388824999332428,"duration":"2.389ms","name":"ActiveRecord","message":"HundredKcal::CardTargetUser Load","payload":{"sql":"SELECT `hundred_kcal_card_target_users`.* FROM `hundred_kcal_card_target_users` WHERE `hundred_kcal_card_target_users`.`deleted_at` IS NULL AND `hundred_kcal_card_target_users`.`target_user_id` = 1","allocations":8,"cached":null}}
  10. {"host":"ip-10-100-6-116.ap-northeast-1.compute.internal","application":"Semantic Logger","environment":"production","timestamp":"2025-09-09T09:47:46.850094Z","level":"debug","level_index":1,"pid":3041,"thread":"1944","file":"(app)","line":2,"duration_ms":2.354526000097394,"duration":"2.355ms","name":"ActiveRecord","message":"HundredKcal::Card Load","payload":{"sql":"SELECT `hundred_kcal_cards`.* FROM `hundred_kcal_cards` WHERE `hundred_kcal_cards`.`deleted_at` IS NULL AND `hundred_kcal_cards`.`id` IN (5, 26, 260)","allocations":8,"cached":null}}
  11. {"host":"ip-10-100-6-116.ap-northeast-1.compute.internal","application":"Semantic Logger","environment":"production","timestamp":"2025-09-09T09:47:46.975292Z","level":"debug","level_index":1,"pid":3041,"thread":"1944","file":"(app)","line":2,"duration_ms":2.328327000141144,"duration":"2.328ms","name":"ActiveRecord","message":"HundredKcal::Category Load","payload":{"sql":"SELECT `hundred_kcal_categories`.* FROM `hundred_kcal_categories` WHERE `hundred_kcal_categories`.`deleted_at` IS NULL AND `hundred_kcal_categories`.`id` IN (2, 9)","allocations":8,"cached":null}}
  12. =>
  13. [nil,
  14. ...
  15. app(prod)> cards
  16. =>
  17. [nil,
  18.  #<HundredKcal::Card:0x0000ffff87080e08
  19.   id: 26,
  20.   company_id: 1,
  21.   hundred_kcal_category_id: 2,
  22.   name: "みかん",
  23.   image: "hundred_kcal_card/images/201.gif",
  24.   sort_order: 1,
  25.   target_user_id: nil,
  26.   company_admin_user_id: nil,
  27.   full_serving_size: "1個:34kcal",
  28.   portion_size: "小3個",
  29.   base_weight: nil,
  30.   consumption_time: nil,
  31.   security_hash: "c6e0cb83fa46e6f9dcb2e2069434c622562bad91f683ef7845...",
  32.   deleted_at: nil,
  33.   created_at: "2025-09-04 12:24:19.689402000 +0900",
  34.   updated_at: "2025-09-04 17:47:37.308982000 +0900",
  35.   is_category_presenter: true>,
  36.  #<HundredKcal::Card:0x0000ffff846b2810
  37.   id: 260,
  38.   company_id: 1,
  39.   hundred_kcal_category_id: 9,
  40.   name: "ゆっくりした歩行",
  41.   image: "hundred_kcal_card/images/ASP002000000201.gif",
  42.   sort_order: 3,
  43.   target_user_id: nil,
  44.   company_admin_user_id: nil,
  45.   full_serving_size: nil,
  46.   portion_size: nil,
  47.   base_weight: 80,
  48.   consumption_time: 29,
  49.   security_hash: "fc407d38ed9fc7c336fba1f6ad20ac7e36d2af9ab29c7aa89a...",
  50.   deleted_at: nil,
  51.   created_at: "2025-09-04 12:24:31.179235000 +0900",
  52.   updated_at: "2025-09-04 12:24:31.179235000 +0900",
  53.   is_category_presenter: false>]
  54. app(prod)> cards.compact
  55. =>
  56. [#<HundredKcal::Card:0x0000ffff87080e08
  57.   id: 26,
  58.   company_id: 1,
  59.   hundred_kcal_category_id: 2,
  60.   name: "みかん",
  61.   image: "hundred_kcal_card/images/201.gif",
  62.   sort_order: 1,
  63.   target_user_id: nil,
  64.   company_admin_user_id: nil,
  65.   full_serving_size: "1個:34kcal",
  66.   portion_size: "小3個",
  67.   base_weight: nil,
  68.   consumption_time: nil,
  69.   security_hash: "c6e0cb83fa46e6f9dcb2e2069434c622562bad91f683ef7845...",
  70.   deleted_at: nil,
  71.   created_at: "2025-09-04 12:24:19.689402000 +0900",
  72.   updated_at: "2025-09-04 17:47:37.308982000 +0900",
  73.   is_category_presenter: true>,
  74.  #<HundredKcal::Card:0x0000ffff846b2810
  75.   id: 260,
  76.   company_id: 1,
  77.   hundred_kcal_category_id: 9,
  78.   name: "ゆっくりした歩行",
  79.   image: "hundred_kcal_card/images/ASP002000000201.gif",
  80.   sort_order: 3,
  81.   target_user_id: nil,
  82.   company_admin_user_id: nil,
  83.   full_serving_size: nil,
  84.   portion_size: nil,
  85.   base_weight: 80,
  86.   consumption_time: 29,
  87.   security_hash: "fc407d38ed9fc7c336fba1f6ad20ac7e36d2af9ab29c7aa89a...",
  88.   deleted_at: nil,
  89.   created_at: "2025-09-04 12:24:31.179235000 +0900",
  90.   updated_at: "2025-09-04 12:24:31.179235000 +0900",
  91.   is_category_presenter: false>]
Advertisement
Add Comment
Please, Sign In to add comment