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

Swars::Grade.setup
tp Swars::Grade

user = Swars::User.find_by(key: "PonaInfinity")
user.grade = Swars::Grade.find_by(key: "十段")
user.valid?



# a = Swars::Grade.find_or_create_by(key: Swars::GradeInfo["十段"].key)
# a.destroy!

# >> |----+------+----------+---------------------------+---------------------------|
# >> | id | key  | priority | created_at                | updated_at                |
# >> |----+------+----------+---------------------------+---------------------------|
# >> | 40 | 十段 |        0 | 2019-01-12 14:05:20 +0900 | 2019-01-12 14:05:20 +0900 |
# >> |  1 | 九段 |        1 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> |  2 | 八段 |        2 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> |  3 | 七段 |        3 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> |  4 | 六段 |        4 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> |  5 | 五段 |        5 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> |  6 | 四段 |        6 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> |  7 | 三段 |        7 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> |  8 | 二段 |        8 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> |  9 | 初段 |        9 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 10 | 1級  |       10 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 11 | 2級  |       11 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 12 | 3級  |       12 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 13 | 4級  |       13 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 14 | 5級  |       14 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 15 | 6級  |       15 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 16 | 7級  |       16 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 17 | 8級  |       17 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 18 | 9級  |       18 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 19 | 10級 |       19 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 20 | 11級 |       20 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 21 | 12級 |       21 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 22 | 13級 |       22 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 23 | 14級 |       23 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 24 | 15級 |       24 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 25 | 16級 |       25 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 26 | 17級 |       26 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 27 | 18級 |       27 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 28 | 19級 |       28 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 29 | 20級 |       29 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 30 | 21級 |       30 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 31 | 22級 |       31 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 32 | 23級 |       32 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 33 | 24級 |       33 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 34 | 25級 |       34 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 35 | 26級 |       35 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 36 | 27級 |       36 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 37 | 28級 |       37 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 38 | 29級 |       38 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> | 39 | 30級 |       39 | 2019-01-12 13:41:52 +0900 | 2019-01-12 14:05:20 +0900 |
# >> |----+------+----------+---------------------------+---------------------------|
