Rails Console Json Data

레일스 콘솔에서 데이터 편하게 보는법.

일단 그냥 보면 되지 굳이 명령어하나 더 치면서 데이터를 확인할까 하지만 데이터가 너무 길고 보기 힘들때 이해도 못하는 데이터 보기라도 편하게 바꿔보자 싶어서 찾아보았다.

먼저 일반적으로 보던 모습이다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
{"id"=>321312312,
"product_id"=>5858457321321223335,
"title"=>"",
"price"=>"17000",
"sku"=>"H59554J1S16C",
"position"=>16,
"inventory_policy"=>"deny",
"compare_at_price"=>nil,
"fulfillment_service"=>"manual",
"inventory_management"=>"shopify",
"option1"=>"brown",
"option2"=>"-4.25",
"option3"=>nil,
"created_at"=>"2020-09-28T16:44:30+09:00",
"updated_at"=>"2022-03-31T23:36:06+09:00",
"taxable"=>true,
"barcode"=>"8809693505654",
"grams"=>37,
"image_id"=>20065729413287,
"weight"=>37.0,
"weight_unit"=>"g",
"inventory_item_id"=>38760799502503,
"inventory_quantity"=>996,
"old_inventory_quantity"=>996,
"requires_shipping"=>false,
{"id"=>36712615346343,
"product_id"=>5858457223335,
"title"=>"brown / -4.50",
"price"=>"17000",
"sku"=>"H59554J1S17C",
"position"=>17,
"inventory_policy"=>"deny",
"compare_at_price"=>nil,
"fulfillment_service"=>"manual",
"inventory_management"=>"shopify",
"option1"=>"brown",
"option2"=>"-4.50",
"option3"=>nil,
"created_at"=>"2020-09-28T16:44:30+09:00",
"updated_at"=>"2022-03-31T23:36:07+09:00",
"taxable"=>true,
"barcode"=>"8809693505661",
"grams"=>37,
"image_id"=>20065729413287,
"weight"=>37.0,
"weight_unit"=>"g",
"inventory_item_id"=>38760799535271,
"inventory_quantity"=>999,
"old_inventory_quantity"=>999,
"requires_shipping"=>false,
"admin_graphql_api_id"=>"gid://shopify/ProductVariant/36712615346343",
"compare_at_price2"=>""},
Author

han Ju Ryeon

Posted on

2022-05-11

Updated on

2022-05-11

Licensed under

댓글