require "#{__dir__}/setup"
user_id = ShareBoard::User.last.id
s { QuickScript::Admin::ShareBoardBattleSearchScript.new(user_id: user_id).call } # => {_component: "QuickScriptViewValueAsTable", _v_bind: {value: {rows: [{"ID" => 1, "部屋情報" => {_nuxt_link: "↗️", _v_bind: {to: {name: "lab-qs_group_key-qs_page_key", params: {qs_group_key: "admin", qs_page_key: "share-board-room-search"}, query: {id: 6}}}}, "部屋" => {_nuxt_link: "8db88c4c6e7b0b7c8c560baa1517b3b6(1)", _v_bind: {to: {name: "lab-qs_group_key-qs_page_key", params: {qs_group_key: "admin", qs_page_key: "share-board-battle-search"}, query: {room_id: 6}}}}, "☗" => {_component: "QuickScriptViewValueAsV", _v_bind: {value: [{_nuxt_link: "alice(1)", _v_bind: {to: {name: "lab-qs_group_key-qs_page_key", params: {qs_group_key: "admin", qs_page_key: "share-board-battle-search"}, query: {user_id: 3}}}}, {_nuxt_link: "carol(1)", _v_bind: {to: {name: "lab-qs_group_key-qs_page_key", params: {qs_group_key: "admin", qs_page_key: "share-board-battle-search"}, query: {user_id: 6}}}}]}}, "☖" => {_component: "QuickScriptViewValueAsV", _v_bind: {value: [{_nuxt_link: "bob(1)", _v_bind: {to: {name: "lab-qs_group_key-qs_page_key", params: {qs_group_key: "admin", qs_page_key: "share-board-battle-search"}, query: {user_id: 5}}}}]}}, "日時" => "2025-08-05 13:18:41", "棋譜" => {_link_to: "4手", _v_bind: {href: "http://localhost:4000/share-board?black=alice%2Ccarol&title=&turn=4&white=bob&xbody=cG9zaXRpb24gc2ZlbiBsbnNna2dzbmwvMXI1YjEvcHBwcHBwcHBwLzkvOS85L1BQUFBQUFBQUC8xQjVSMS9MTlNHS0dTTkwgYiAtIDEgbW92ZXMgN2c3ZiAzYzNkIDhoMmIrIDNhMmI", target: "_blank"}}, "履歴" => {_link_to: "履歴", _v_bind: {href: "http://localhost:4000/share-board/dashboard?room_key=8db88c4c6e7b0b7c8c560baa1517b3b6", target: "_blank"}}, "入室" => {_link_to: "入室", _v_bind: {href: "http://localhost:4000/share-board?room_key=8db88c4c6e7b0b7c8c560baa1517b3b6", target: "_blank"}}}], paginated: true, total: 1, current_page: 1, per_page: 100, always_table: true, header_hide: false}}}
# >>   Location Load (0.3ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`key` = 'black' ORDER BY `locations`.`position` ASC LIMIT 1 /*application='ShogiWeb'*/
# >>   ↳ app/models/application_memory_record.rb:36:in 'ApplicationMemoryRecord#db_record!'
# >>   Location Load (0.3ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`key` = 'white' ORDER BY `locations`.`position` ASC LIMIT 1 /*application='ShogiWeb'*/
# >>   ↳ app/models/application_memory_record.rb:36:in 'ApplicationMemoryRecord#db_record!'
# >>   SQL (1.3ms)  SELECT DISTINCT `share_board_battles`.`created_at` AS alias_0, `share_board_battles`.`id` FROM `share_board_battles` LEFT OUTER JOIN `share_board_memberships` `memberships` ON `memberships`.`battle_id` = `share_board_battles`.`id` LEFT OUTER JOIN `share_board_users` ON `share_board_users`.`id` = `memberships`.`user_id` LEFT OUTER JOIN `share_board_memberships` `memberships_share_board_users` ON `memberships_share_board_users`.`user_id` = `share_board_users`.`id` LEFT OUTER JOIN `share_board_rooms` ON `share_board_rooms`.`id` = `share_board_battles`.`room_id` LEFT OUTER JOIN `share_board_battles` `battles_share_board_rooms` ON `battles_share_board_rooms`.`room_id` = `share_board_rooms`.`id` LEFT OUTER JOIN `share_board_memberships` ON `share_board_memberships`.`location_id` = 1 AND `share_board_memberships`.`battle_id` = `share_board_battles`.`id` LEFT OUTER JOIN `share_board_users` `users_share_board_memberships` ON `users_share_board_memberships`.`id` = `share_board_memberships`.`user_id` LEFT OUTER JOIN `share_board_memberships` `whites_share_board_battles` ON `whites_share_board_battles`.`location_id` = 2 AND `whites_share_board_battles`.`battle_id` = `share_board_battles`.`id` LEFT OUTER JOIN `share_board_users` `users_share_board_memberships_2` ON `users_share_board_memberships_2`.`id` = `whites_share_board_battles`.`user_id` WHERE `memberships`.`user_id` = 6 ORDER BY `share_board_battles`.`created_at` DESC LIMIT 100 OFFSET 0 /*application='ShogiWeb'*/
# >>   ↳ app/models/quick_script/admin/share_board_battle_search_script.rb:11:in 'Enumerable#collect'
# >>   Location Load (0.2ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`key` = 'black' ORDER BY `locations`.`position` ASC LIMIT 1 /*application='ShogiWeb'*/
# >>   ↳ app/models/application_memory_record.rb:36:in 'ApplicationMemoryRecord#db_record!'
# >>   Location Load (0.3ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`key` = 'white' ORDER BY `locations`.`position` ASC LIMIT 1 /*application='ShogiWeb'*/
# >>   ↳ app/models/application_memory_record.rb:36:in 'ApplicationMemoryRecord#db_record!'
# >>   SQL (1.3ms)  SELECT `share_board_battles`.`id` AS t0_r0, `share_board_battles`.`room_id` AS t0_r1, `share_board_battles`.`key` AS t0_r2, `share_board_battles`.`title` AS t0_r3, `share_board_battles`.`sfen` AS t0_r4, `share_board_battles`.`turn` AS t0_r5, `share_board_battles`.`win_location_id` AS t0_r6, `share_board_battles`.`position` AS t0_r7, `share_board_battles`.`created_at` AS t0_r8, `share_board_battles`.`updated_at` AS t0_r9, `memberships`.`id` AS t1_r0, `memberships`.`battle_id` AS t1_r1, `memberships`.`user_id` AS t1_r2, `memberships`.`judge_id` AS t1_r3, `memberships`.`location_id` AS t1_r4, `memberships`.`position` AS t1_r5, `memberships`.`created_at` AS t1_r6, `memberships`.`updated_at` AS t1_r7, `share_board_users`.`id` AS t2_r0, `share_board_users`.`name` AS t2_r1, `share_board_users`.`memberships_count` AS t2_r2, `share_board_users`.`created_at` AS t2_r3, `share_board_users`.`updated_at` AS t2_r4, `share_board_users`.`chat_messages_count` AS t2_r5, `memberships_share_board_users`.`id` AS t3_r0, `memberships_share_board_users`.`battle_id` AS t3_r1, `memberships_share_board_users`.`user_id` AS t3_r2, `memberships_share_board_users`.`judge_id` AS t3_r3, `memberships_share_board_users`.`location_id` AS t3_r4, `memberships_share_board_users`.`position` AS t3_r5, `memberships_share_board_users`.`created_at` AS t3_r6, `memberships_share_board_users`.`updated_at` AS t3_r7, `share_board_rooms`.`id` AS t4_r0, `share_board_rooms`.`key` AS t4_r1, `share_board_rooms`.`battles_count` AS t4_r2, `share_board_rooms`.`created_at` AS t4_r3, `share_board_rooms`.`updated_at` AS t4_r4, `share_board_rooms`.`chat_messages_count` AS t4_r5, `battles_share_board_rooms`.`id` AS t5_r0, `battles_share_board_rooms`.`room_id` AS t5_r1, `battles_share_board_rooms`.`key` AS t5_r2, `battles_share_board_rooms`.`title` AS t5_r3, `battles_share_board_rooms`.`sfen` AS t5_r4, `battles_share_board_rooms`.`turn` AS t5_r5, `battles_share_board_rooms`.`win_location_id` AS t5_r6, `battles_share_board_rooms`.`position` AS t5_r7, `battles_share_board_rooms`.`created_at` AS t5_r8, `battles_share_board_rooms`.`updated_at` AS t5_r9, `share_board_memberships`.`id` AS t6_r0, `share_board_memberships`.`battle_id` AS t6_r1, `share_board_memberships`.`user_id` AS t6_r2, `share_board_memberships`.`judge_id` AS t6_r3, `share_board_memberships`.`location_id` AS t6_r4, `share_board_memberships`.`position` AS t6_r5, `share_board_memberships`.`created_at` AS t6_r6, `share_board_memberships`.`updated_at` AS t6_r7, `users_share_board_memberships`.`id` AS t7_r0, `users_share_board_memberships`.`name` AS t7_r1, `users_share_board_memberships`.`memberships_count` AS t7_r2, `users_share_board_memberships`.`created_at` AS t7_r3, `users_share_board_memberships`.`updated_at` AS t7_r4, `users_share_board_memberships`.`chat_messages_count` AS t7_r5, `whites_share_board_battles`.`id` AS t8_r0, `whites_share_board_battles`.`battle_id` AS t8_r1, `whites_share_board_battles`.`user_id` AS t8_r2, `whites_share_board_battles`.`judge_id` AS t8_r3, `whites_share_board_battles`.`location_id` AS t8_r4, `whites_share_board_battles`.`position` AS t8_r5, `whites_share_board_battles`.`created_at` AS t8_r6, `whites_share_board_battles`.`updated_at` AS t8_r7, `users_share_board_memberships_2`.`id` AS t9_r0, `users_share_board_memberships_2`.`name` AS t9_r1, `users_share_board_memberships_2`.`memberships_count` AS t9_r2, `users_share_board_memberships_2`.`created_at` AS t9_r3, `users_share_board_memberships_2`.`updated_at` AS t9_r4, `users_share_board_memberships_2`.`chat_messages_count` AS t9_r5 FROM `share_board_battles` LEFT OUTER JOIN `share_board_memberships` `memberships` ON `memberships`.`battle_id` = `share_board_battles`.`id` LEFT OUTER JOIN `share_board_users` ON `share_board_users`.`id` = `memberships`.`user_id` LEFT OUTER JOIN `share_board_memberships` `memberships_share_board_users` ON `memberships_share_board_users`.`user_id` = `share_board_users`.`id` LEFT OUTER JOIN `share_board_rooms` ON `share_board_rooms`.`id` = `share_board_battles`.`room_id` LEFT OUTER JOIN `share_board_battles` `battles_share_board_rooms` ON `battles_share_board_rooms`.`room_id` = `share_board_rooms`.`id` LEFT OUTER JOIN `share_board_memberships` ON `share_board_memberships`.`location_id` = 1 AND `share_board_memberships`.`battle_id` = `share_board_battles`.`id` LEFT OUTER JOIN `share_board_users` `users_share_board_memberships` ON `users_share_board_memberships`.`id` = `share_board_memberships`.`user_id` LEFT OUTER JOIN `share_board_memberships` `whites_share_board_battles` ON `whites_share_board_battles`.`location_id` = 2 AND `whites_share_board_battles`.`battle_id` = `share_board_battles`.`id` LEFT OUTER JOIN `share_board_users` `users_share_board_memberships_2` ON `users_share_board_memberships_2`.`id` = `whites_share_board_battles`.`user_id` WHERE `memberships`.`user_id` = 6 AND `share_board_battles`.`id` = 1 ORDER BY `share_board_battles`.`created_at` DESC /*application='ShogiWeb'*/
# >>   ↳ app/models/quick_script/admin/share_board_battle_search_script.rb:11:in 'Enumerable#collect'
# >>   Location Load (0.3ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`key` = 'black' ORDER BY `locations`.`position` ASC LIMIT 1 /*application='ShogiWeb'*/
# >>   ↳ app/models/application_memory_record.rb:36:in 'ApplicationMemoryRecord#db_record!'
# >>   Location Load (0.3ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`key` = 'black' ORDER BY `locations`.`position` ASC LIMIT 1 /*application='ShogiWeb'*/
# >>   ↳ app/models/application_memory_record.rb:36:in 'ApplicationMemoryRecord#db_record!'
# >>   Location Load (0.2ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`key` = 'white' ORDER BY `locations`.`position` ASC LIMIT 1 /*application='ShogiWeb'*/
# >>   ↳ app/models/application_memory_record.rb:36:in 'ApplicationMemoryRecord#db_record!'
# >>   Location Load (0.3ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`key` = 'white' ORDER BY `locations`.`position` ASC LIMIT 1 /*application='ShogiWeb'*/
# >>   ↳ app/models/application_memory_record.rb:36:in 'ApplicationMemoryRecord#db_record!'
# >>   Location Load (0.3ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`key` = 'black' ORDER BY `locations`.`position` ASC LIMIT 1 /*application='ShogiWeb'*/
# >>   ↳ app/models/application_memory_record.rb:36:in 'ApplicationMemoryRecord#db_record!'
# >>   Location Load (0.3ms)  SELECT `locations`.* FROM `locations` WHERE `locations`.`key` = 'white' ORDER BY `locations`.`position` ASC LIMIT 1 /*application='ShogiWeb'*/
# >>   ↳ app/models/application_memory_record.rb:36:in 'ApplicationMemoryRecord#db_record!'
