#!/usr/bin/env ruby
require File.expand_path('../../config/environment', __FILE__)

# tono447-Shinshu-20191013_145945

r = Swars::Battle.find(192482)
r.rebuild

r = Swars::Battle.find(192482)
r.memberships.last.attack_tag_list # => ["一間飛車", "裏アヒル戦法"]

a = Swars::Battle.tagged_with("裏アヒル戦法").first
tp a.meta_info
tp a.attack_tag_list

tp a

# tp Swars::Battle
# >> .|----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
# >> |         header | {"先手"=>"tono447 初段", "後手"=>"Shinshu 三段", "開始日時"=>"2019/10/13 14:59:45", "棋戦"=>"将棋ウォーズ(10分切れ負け)", "場所"=>"https://shogiwars.heroz.jp/games/tono447-Shinshu-20191013_145945", "持ち時間"=>"00:10+00", "先手の囲い"=>"舟囲い", "後手の囲い"=>"裏アヒル囲い", "後手の戦型"=>"一間飛車, 裏アヒル戦法", "先手の備考"... |
# >> |   detail_names | [[], []]                                                                                                                                                                                                                                                                                                                                  |
# >> |   simple_names | [[["tono447", "初段"]], [["Shinshu", "三段"]]]                                                                                                                                                                                                                                                                                            |
# >> | skill_set_hash | {"先手の囲い"=>["舟囲い"], "後手の囲い"=>["裏アヒル囲い"], "後手の戦型"=>["一間飛車", "裏アヒル戦法"], "先手の備考"=>["居飛車", "相居飛車"], "後手の備考"=>["居飛車", "相居飛車"]}                                                                                                                                                        |
# >> |----------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
# >> |--------------|
# >> | 一間飛車     |
# >> | 裏アヒル戦法 |
# >> |--------------|
# >> |--------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
# >> |                 id | 190630                                                                                                                                                                                                                                                                                                                               |
# >> |                key | tono447-Shinshu-20191013_145945                                                                                                                                                                                                                                                                                                      |
# >> |         battled_at | 2019-10-13 14:59:45 +0900                                                                                                                                                                                                                                                                                                            |
# >> |           rule_key | ten_min                                                                                                                                                                                                                                                                                                                              |
# >> |            csa_seq | [["+7776FU", 599], ["-9394FU", 600], ["+2726FU", 592], ["-9495FU", 599], ["+2625FU", 589], ["-3132GI", 597], ["+3948GI", 571], ["-1314FU", 595], ["+2524FU", 564], ["-2324FU", 589], ["+2824HI", 562], ["-0023FU", 586], ["+2426HI", 553], ["-8292HI", 585], ["+...                                                                  |
# >> |          final_key | TORYO                                                                                                                                                                                                                                                                                                                                |
# >> |        win_user_id | 15917                                                                                                                                                                                                                                                                                                                                |
# >> |           turn_max | 63                                                                                                                                                                                                                                                                                                                                   |
# >> |          meta_info | {:header=>{"先手"=>"tono447 初段", "後手"=>"Shinshu 三段", "開始日時"=>"2019/10/13 14:59:45", "棋戦"=>"将棋ウォーズ(10分切れ負け)", "場所"=>"https://shogiwars.heroz.jp/games/tono447-Shinshu-20191013_145945", "持ち時間"=>"00:10+00", "先手の囲い"=>"舟囲い", "後手の囲い"=>"裏アヒル囲い", "後手の戦型"=>"一間飛車, 裏アヒル戦法... |
# >> |    last_accessd_at | 2019-10-13 23:50:56 +0900                                                                                                                                                                                                                                                                                                            |
# >> |  access_logs_count | 0                                                                                                                                                                                                                                                                                                                                    |
# >> |         created_at | 2019-10-13 23:50:57 +0900                                                                                                                                                                                                                                                                                                            |
# >> |         updated_at | 2019-10-17 16:34:26 +0900                                                                                                                                                                                                                                                                                                            |
# >> |         preset_key | 平手                                                                                                                                                                                                                                                                                                                                 |
# >> |         start_turn |                                                                                                                                                                                                                                                                                                                                      |
# >> |      critical_turn | 9                                                                                                                                                                                                                                                                                                                                    |
# >> |         saturn_key | public                                                                                                                                                                                                                                                                                                                               |
# >> |          sfen_body | position startpos moves 7g7f 9c9d 2g2f 9d9e 2f2e 3a3b 3i4h 1c1d 2e2d 2c2d 2h2d P*2c 2d2f 8b9b 4i5h 9b9d 5i6h 7a7b 6h7h 2b1c 8h7g 9d7d 9i9h 1c3e 2f3f 7d3d 6i6h 5a5b 5g5f 3e6h+ 7g6h 3d3f 3g3f R*2h 2i3g G*4i 4h5i 4i5i 5h5i S*5g B*8b 5g6h 7i6h B*4h 5i4h 2h4h+ ...                                                                  |
# >> |         image_turn |                                                                                                                                                                                                                                                                                                                                      |
# >> |   defense_tag_list |                                                                                                                                                                                                                                                                                                                                      |
# >> |    attack_tag_list |                                                                                                                                                                                                                                                                                                                                      |
# >> | technique_tag_list |                                                                                                                                                                                                                                                                                                                                      |
# >> |      note_tag_list |                                                                                                                                                                                                                                                                                                                                      |
# >> |     other_tag_list |                                                                                                                                                                                                                                                                                                                                      |
# >> |    secret_tag_list |                                                                                                                                                                                                                                                                                                                                      |
# >> | kifu_body_for_test |                                                                                                                                                                                                                                                                                                                                      |
# >> |--------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
