Merge pull request #36 from jedmund/party-details-upgrade
Add new fields to Parties
This commit is contained in:
commit
248a3df375
10 changed files with 94 additions and 48 deletions
1
.ruby-gemset
Normal file
1
.ruby-gemset
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
granblue
|
||||||
81
Gemfile.lock
81
Gemfile.lock
|
|
@ -71,7 +71,7 @@ GEM
|
||||||
activesupport (>= 3.2.5)
|
activesupport (>= 3.2.5)
|
||||||
nokogiri (>= 1.5.2)
|
nokogiri (>= 1.5.2)
|
||||||
rspec (>= 3.1)
|
rspec (>= 3.1)
|
||||||
apipie-rails (0.8.2)
|
apipie-rails (0.9.0)
|
||||||
actionpack (>= 5.0)
|
actionpack (>= 5.0)
|
||||||
activesupport (>= 5.0)
|
activesupport (>= 5.0)
|
||||||
ast (2.4.2)
|
ast (2.4.2)
|
||||||
|
|
@ -79,9 +79,9 @@ GEM
|
||||||
activerecord (>= 4.0.0, < 7.1)
|
activerecord (>= 4.0.0, < 7.1)
|
||||||
backport (1.2.0)
|
backport (1.2.0)
|
||||||
bcrypt (3.1.18)
|
bcrypt (3.1.18)
|
||||||
benchmark (0.2.0)
|
benchmark (0.2.1)
|
||||||
blueprinter (0.25.3)
|
blueprinter (0.25.3)
|
||||||
bootsnap (1.13.0)
|
bootsnap (1.15.0)
|
||||||
msgpack (~> 1.2)
|
msgpack (~> 1.2)
|
||||||
builder (3.2.4)
|
builder (3.2.4)
|
||||||
byebug (11.1.3)
|
byebug (11.1.3)
|
||||||
|
|
@ -96,9 +96,10 @@ GEM
|
||||||
activerecord (>= 5.a)
|
activerecord (>= 5.a)
|
||||||
database_cleaner-core (~> 2.0.0)
|
database_cleaner-core (~> 2.0.0)
|
||||||
database_cleaner-core (2.0.1)
|
database_cleaner-core (2.0.1)
|
||||||
|
date (3.3.3)
|
||||||
diff-lcs (1.5.0)
|
diff-lcs (1.5.0)
|
||||||
docile (1.4.0)
|
docile (1.4.0)
|
||||||
doorkeeper (5.6.0)
|
doorkeeper (5.6.2)
|
||||||
railties (>= 5)
|
railties (>= 5)
|
||||||
dotenv (2.8.1)
|
dotenv (2.8.1)
|
||||||
dotenv-rails (2.8.1)
|
dotenv-rails (2.8.1)
|
||||||
|
|
@ -107,18 +108,18 @@ GEM
|
||||||
e2mmap (0.1.0)
|
e2mmap (0.1.0)
|
||||||
email_validator (2.2.4)
|
email_validator (2.2.4)
|
||||||
activemodel
|
activemodel
|
||||||
erubi (1.11.0)
|
erubi (1.12.0)
|
||||||
factory_bot (6.2.1)
|
factory_bot (6.2.1)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
factory_bot_rails (6.2.0)
|
factory_bot_rails (6.2.0)
|
||||||
factory_bot (~> 6.2.0)
|
factory_bot (~> 6.2.0)
|
||||||
railties (>= 5.0.0)
|
railties (>= 5.0.0)
|
||||||
faker (3.0.0)
|
faker (3.1.0)
|
||||||
i18n (>= 1.8.11, < 2)
|
i18n (>= 1.8.11, < 2)
|
||||||
ffi (1.15.5)
|
ffi (1.15.5)
|
||||||
figaro (1.2.0)
|
figaro (1.2.0)
|
||||||
thor (>= 0.14.0, < 2)
|
thor (>= 0.14.0, < 2)
|
||||||
gemoji (3.0.1)
|
gemoji (4.0.1)
|
||||||
gemoji-parser (1.3.1)
|
gemoji-parser (1.3.1)
|
||||||
gemoji (>= 2.1.0)
|
gemoji (>= 2.1.0)
|
||||||
globalid (1.0.0)
|
globalid (1.0.0)
|
||||||
|
|
@ -126,7 +127,7 @@ GEM
|
||||||
i18n (1.12.0)
|
i18n (1.12.0)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
jaro_winkler (1.5.4)
|
jaro_winkler (1.5.4)
|
||||||
json (2.6.2)
|
json (2.6.3)
|
||||||
kramdown (2.4.0)
|
kramdown (2.4.0)
|
||||||
rexml
|
rexml
|
||||||
kramdown-parser-gfm (1.1.0)
|
kramdown-parser-gfm (1.1.0)
|
||||||
|
|
@ -134,43 +135,47 @@ GEM
|
||||||
listen (3.7.1)
|
listen (3.7.1)
|
||||||
rb-fsevent (~> 0.10, >= 0.10.3)
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
||||||
rb-inotify (~> 0.9, >= 0.9.10)
|
rb-inotify (~> 0.9, >= 0.9.10)
|
||||||
loofah (2.19.0)
|
loofah (2.19.1)
|
||||||
crass (~> 1.0.2)
|
crass (~> 1.0.2)
|
||||||
nokogiri (>= 1.5.9)
|
nokogiri (>= 1.5.9)
|
||||||
mail (2.7.1)
|
mail (2.8.0)
|
||||||
mini_mime (>= 0.1.1)
|
mini_mime (>= 0.1.1)
|
||||||
|
net-imap
|
||||||
|
net-pop
|
||||||
|
net-smtp
|
||||||
marcel (1.0.2)
|
marcel (1.0.2)
|
||||||
method_source (1.0.0)
|
method_source (1.0.0)
|
||||||
mini_mime (1.1.2)
|
mini_mime (1.1.2)
|
||||||
mini_portile2 (2.6.1)
|
mini_portile2 (2.8.1)
|
||||||
minitest (5.16.3)
|
minitest (5.17.0)
|
||||||
msgpack (1.6.0)
|
msgpack (1.6.0)
|
||||||
net-imap (0.3.1)
|
net-imap (0.3.4)
|
||||||
|
date
|
||||||
net-protocol
|
net-protocol
|
||||||
net-pop (0.1.2)
|
net-pop (0.1.2)
|
||||||
net-protocol
|
net-protocol
|
||||||
net-protocol (0.1.3)
|
net-protocol (0.2.1)
|
||||||
timeout
|
timeout
|
||||||
net-smtp (0.3.3)
|
net-smtp (0.3.3)
|
||||||
net-protocol
|
net-protocol
|
||||||
nio4r (2.5.8)
|
nio4r (2.5.8)
|
||||||
nokogiri (1.12.5)
|
nokogiri (1.13.10)
|
||||||
mini_portile2 (~> 2.6.1)
|
mini_portile2 (~> 2.8.0)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
oj (3.13.23)
|
oj (3.13.23)
|
||||||
parallel (1.22.1)
|
parallel (1.22.1)
|
||||||
parser (3.1.2.1)
|
parser (3.2.0.0)
|
||||||
ast (~> 2.4.1)
|
ast (~> 2.4.1)
|
||||||
pg (1.4.4)
|
pg (1.4.5)
|
||||||
pg_search (2.3.6)
|
pg_search (2.3.6)
|
||||||
activerecord (>= 5.2)
|
activerecord (>= 5.2)
|
||||||
activesupport (>= 5.2)
|
activesupport (>= 5.2)
|
||||||
psych (4.0.6)
|
psych (5.0.1)
|
||||||
stringio
|
stringio
|
||||||
puma (6.0.0)
|
puma (6.0.2)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
racc (1.6.0)
|
racc (1.6.2)
|
||||||
rack (2.2.4)
|
rack (2.2.5)
|
||||||
rack-cors (1.1.1)
|
rack-cors (1.1.1)
|
||||||
rack (>= 2.0.0)
|
rack (>= 2.0.0)
|
||||||
rack-test (2.0.2)
|
rack-test (2.0.2)
|
||||||
|
|
@ -192,8 +197,8 @@ GEM
|
||||||
rails-dom-testing (2.0.3)
|
rails-dom-testing (2.0.3)
|
||||||
activesupport (>= 4.2.0)
|
activesupport (>= 4.2.0)
|
||||||
nokogiri (>= 1.6)
|
nokogiri (>= 1.6)
|
||||||
rails-html-sanitizer (1.4.3)
|
rails-html-sanitizer (1.4.4)
|
||||||
loofah (~> 2.3)
|
loofah (~> 2.19, >= 2.19.1)
|
||||||
railties (7.0.4)
|
railties (7.0.4)
|
||||||
actionpack (= 7.0.4)
|
actionpack (= 7.0.4)
|
||||||
activesupport (= 7.0.4)
|
activesupport (= 7.0.4)
|
||||||
|
|
@ -206,9 +211,9 @@ GEM
|
||||||
rb-fsevent (0.11.2)
|
rb-fsevent (0.11.2)
|
||||||
rb-inotify (0.10.1)
|
rb-inotify (0.10.1)
|
||||||
ffi (~> 1.0)
|
ffi (~> 1.0)
|
||||||
rdoc (6.4.0)
|
rdoc (6.5.0)
|
||||||
psych (>= 4.0.0)
|
psych (>= 4.0.0)
|
||||||
regexp_parser (2.6.0)
|
regexp_parser (2.6.1)
|
||||||
responders (3.0.1)
|
responders (3.0.1)
|
||||||
actionpack (>= 5.0)
|
actionpack (>= 5.0)
|
||||||
railties (>= 5.0)
|
railties (>= 5.0)
|
||||||
|
|
@ -221,10 +226,10 @@ GEM
|
||||||
rspec-mocks (~> 3.12.0)
|
rspec-mocks (~> 3.12.0)
|
||||||
rspec-core (3.12.0)
|
rspec-core (3.12.0)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.12.0)
|
||||||
rspec-expectations (3.12.0)
|
rspec-expectations (3.12.1)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.12.0)
|
||||||
rspec-mocks (3.12.0)
|
rspec-mocks (3.12.1)
|
||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.12.0)
|
rspec-support (~> 3.12.0)
|
||||||
rspec-rails (6.0.1)
|
rspec-rails (6.0.1)
|
||||||
|
|
@ -238,30 +243,30 @@ GEM
|
||||||
rspec-support (3.12.0)
|
rspec-support (3.12.0)
|
||||||
rspec_junit_formatter (0.6.0)
|
rspec_junit_formatter (0.6.0)
|
||||||
rspec-core (>= 2, < 4, != 2.12.0)
|
rspec-core (>= 2, < 4, != 2.12.0)
|
||||||
rubocop (1.38.0)
|
rubocop (1.42.0)
|
||||||
json (~> 2.3)
|
json (~> 2.3)
|
||||||
parallel (~> 1.10)
|
parallel (~> 1.10)
|
||||||
parser (>= 3.1.2.1)
|
parser (>= 3.1.2.1)
|
||||||
rainbow (>= 2.2.2, < 4.0)
|
rainbow (>= 2.2.2, < 4.0)
|
||||||
regexp_parser (>= 1.8, < 3.0)
|
regexp_parser (>= 1.8, < 3.0)
|
||||||
rexml (>= 3.2.5, < 4.0)
|
rexml (>= 3.2.5, < 4.0)
|
||||||
rubocop-ast (>= 1.23.0, < 2.0)
|
rubocop-ast (>= 1.24.1, < 2.0)
|
||||||
ruby-progressbar (~> 1.7)
|
ruby-progressbar (~> 1.7)
|
||||||
unicode-display_width (>= 1.4.0, < 3.0)
|
unicode-display_width (>= 1.4.0, < 3.0)
|
||||||
rubocop-ast (1.23.0)
|
rubocop-ast (1.24.1)
|
||||||
parser (>= 3.1.1.0)
|
parser (>= 3.1.1.0)
|
||||||
ruby-progressbar (1.11.0)
|
ruby-progressbar (1.11.0)
|
||||||
sdoc (2.4.0)
|
sdoc (2.5.0)
|
||||||
rdoc (>= 5.0)
|
rdoc (>= 5.0)
|
||||||
shoulda-matchers (5.2.0)
|
shoulda-matchers (5.3.0)
|
||||||
activesupport (>= 5.2.0)
|
activesupport (>= 5.2.0)
|
||||||
simplecov (0.21.2)
|
simplecov (0.22.0)
|
||||||
docile (~> 1.1)
|
docile (~> 1.1)
|
||||||
simplecov-html (~> 0.11)
|
simplecov-html (~> 0.11)
|
||||||
simplecov_json_formatter (~> 0.1)
|
simplecov_json_formatter (~> 0.1)
|
||||||
simplecov-html (0.12.3)
|
simplecov-html (0.12.3)
|
||||||
simplecov_json_formatter (0.1.4)
|
simplecov_json_formatter (0.1.4)
|
||||||
solargraph (0.47.2)
|
solargraph (0.48.0)
|
||||||
backport (~> 1.2)
|
backport (~> 1.2)
|
||||||
benchmark
|
benchmark
|
||||||
bundler (>= 1.17.2)
|
bundler (>= 1.17.2)
|
||||||
|
|
@ -279,13 +284,13 @@ GEM
|
||||||
spring (4.1.0)
|
spring (4.1.0)
|
||||||
spring-commands-rspec (1.0.4)
|
spring-commands-rspec (1.0.4)
|
||||||
spring (>= 0.9.1)
|
spring (>= 0.9.1)
|
||||||
stringio (3.0.2)
|
stringio (3.0.4)
|
||||||
thor (1.2.1)
|
thor (1.2.1)
|
||||||
tilt (2.0.11)
|
tilt (2.0.11)
|
||||||
timeout (0.3.0)
|
timeout (0.3.1)
|
||||||
tzinfo (2.0.5)
|
tzinfo (2.0.5)
|
||||||
concurrent-ruby (~> 1.0)
|
concurrent-ruby (~> 1.0)
|
||||||
unicode-display_width (2.3.0)
|
unicode-display_width (2.4.0)
|
||||||
webrick (1.7.0)
|
webrick (1.7.0)
|
||||||
websocket-driver (0.7.5)
|
websocket-driver (0.7.5)
|
||||||
websocket-extensions (>= 0.1.0)
|
websocket-extensions (>= 0.1.0)
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,8 @@ module Api
|
||||||
end
|
end
|
||||||
|
|
||||||
view :minimal do
|
view :minimal do
|
||||||
fields :name, :element, :shortcode, :favorited, :extra, :created_at, :updated_at
|
fields :name, :element, :shortcode, :favorited, :extra,
|
||||||
|
:full_auto, :clear_time, :auto_guard, :created_at, :updated_at
|
||||||
|
|
||||||
association :raid,
|
association :raid,
|
||||||
blueprint: RaidBlueprint
|
blueprint: RaidBlueprint
|
||||||
|
|
@ -63,7 +64,7 @@ module Api
|
||||||
include_view :characters
|
include_view :characters
|
||||||
include_view :job_skills
|
include_view :job_skills
|
||||||
|
|
||||||
fields :description, :extra
|
fields :description, :charge_attack, :button_count, :turn_count, :chain_count
|
||||||
end
|
end
|
||||||
|
|
||||||
view :collection do
|
view :collection do
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ module Api
|
||||||
def build_conditions(params)
|
def build_conditions(params)
|
||||||
unless params['recency'].blank?
|
unless params['recency'].blank?
|
||||||
start_time = (DateTime.current - params['recency'].to_i.seconds)
|
start_time = (DateTime.current - params['recency'].to_i.seconds)
|
||||||
.to_datetime.beginning_of_day
|
.to_datetime.beginning_of_day
|
||||||
end
|
end
|
||||||
|
|
||||||
{}.tap do |hash|
|
{}.tap do |hash|
|
||||||
|
|
@ -142,7 +142,14 @@ module Api
|
||||||
:skill0_id,
|
:skill0_id,
|
||||||
:skill1_id,
|
:skill1_id,
|
||||||
:skill2_id,
|
:skill2_id,
|
||||||
:skill3_id
|
:skill3_id,
|
||||||
|
:full_auto,
|
||||||
|
:auto_guard,
|
||||||
|
:charge_attack,
|
||||||
|
:clear_time,
|
||||||
|
:button_count,
|
||||||
|
:turn_count,
|
||||||
|
:chain_count
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ Bundler.require(*Rails.groups)
|
||||||
module HenseiApi
|
module HenseiApi
|
||||||
class Application < Rails::Application
|
class Application < Rails::Application
|
||||||
# Initialize configuration defaults for originally generated Rails version.
|
# Initialize configuration defaults for originally generated Rails version.
|
||||||
config.load_defaults 6.0
|
config.load_defaults 7.0
|
||||||
|
|
||||||
# Settings in config/environments/* take precedence over those specified here.
|
# Settings in config/environments/* take precedence over those specified here.
|
||||||
# Application configuration can go into files in config/initializers
|
# Application configuration can go into files in config/initializers
|
||||||
|
|
|
||||||
12
db/migrate/20230103111523_add_new_party_details.rb
Normal file
12
db/migrate/20230103111523_add_new_party_details.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
class AddNewPartyDetails < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
add_column :parties, :full_auto, :boolean, default: false, null: false
|
||||||
|
add_column :parties, :auto_guard, :boolean, default: false, null: false
|
||||||
|
add_column :parties, :charge_attack, :boolean, default: false, null: false
|
||||||
|
|
||||||
|
add_column :parties, :clear_time, :integer, default: 0, null: false
|
||||||
|
add_column :parties, :button_count, :integer, default: 0, null: false
|
||||||
|
add_column :parties, :chain_count, :integer, default: 0, null: false
|
||||||
|
add_column :parties, :turn_count, :integer, default: 0, null: false
|
||||||
|
end
|
||||||
|
end
|
||||||
5
db/migrate/20230103150807_update_turn_count_default.rb
Normal file
5
db/migrate/20230103150807_update_turn_count_default.rb
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
class UpdateTurnCountDefault < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
change_column :parties, :turn_count, :integer, null: false, default: 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
class UpdateNullableOnPartyDetails < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
change_column :parties, :button_count, :integer, null: true, default: nil
|
||||||
|
change_column :parties, :chain_count, :integer, null: true, default: nil
|
||||||
|
change_column :parties, :turn_count, :integer, null: true, default: nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
class ChangeDefaultValueOnChargeAttack < ActiveRecord::Migration[7.0]
|
||||||
|
def change
|
||||||
|
change_column :parties, :charge_attack, :boolean, null: false, default: true
|
||||||
|
end
|
||||||
|
end
|
||||||
13
db/schema.rb
13
db/schema.rb
|
|
@ -10,13 +10,12 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema[7.0].define(version: 2023_01_02_235042) do
|
ActiveRecord::Schema[7.0].define(version: 2023_01_03_180458) do
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "btree_gin"
|
enable_extension "btree_gin"
|
||||||
enable_extension "pg_trgm"
|
enable_extension "pg_trgm"
|
||||||
enable_extension "pgcrypto"
|
enable_extension "pgcrypto"
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
enable_extension "timescaledb"
|
|
||||||
|
|
||||||
create_table "characters", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
create_table "characters", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||||
t.string "name_en"
|
t.string "name_en"
|
||||||
|
|
@ -119,9 +118,6 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_02_235042) do
|
||||||
t.integer "awakening_level", default: 1, null: false
|
t.integer "awakening_level", default: 1, null: false
|
||||||
t.index ["party_id"], name: "index_grid_weapons_on_party_id"
|
t.index ["party_id"], name: "index_grid_weapons_on_party_id"
|
||||||
t.index ["weapon_id"], name: "index_grid_weapons_on_weapon_id"
|
t.index ["weapon_id"], name: "index_grid_weapons_on_weapon_id"
|
||||||
t.index ["weapon_key1_id"], name: "index_grid_weapons_on_weapon_key1_id"
|
|
||||||
t.index ["weapon_key2_id"], name: "index_grid_weapons_on_weapon_key2_id"
|
|
||||||
t.index ["weapon_key3_id"], name: "index_grid_weapons_on_weapon_key3_id"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "job_skills", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
create_table "job_skills", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
|
||||||
|
|
@ -205,6 +201,13 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_02_235042) do
|
||||||
t.uuid "skill2_id"
|
t.uuid "skill2_id"
|
||||||
t.uuid "skill3_id"
|
t.uuid "skill3_id"
|
||||||
t.uuid "skill0_id"
|
t.uuid "skill0_id"
|
||||||
|
t.boolean "full_auto", default: false, null: false
|
||||||
|
t.boolean "auto_guard", default: false, null: false
|
||||||
|
t.boolean "charge_attack", default: true, null: false
|
||||||
|
t.integer "clear_time", default: 0, null: false
|
||||||
|
t.integer "button_count"
|
||||||
|
t.integer "chain_count"
|
||||||
|
t.integer "turn_count"
|
||||||
t.index ["job_id"], name: "index_parties_on_job_id"
|
t.index ["job_id"], name: "index_parties_on_job_id"
|
||||||
t.index ["skill0_id"], name: "index_parties_on_skill0_id"
|
t.index ["skill0_id"], name: "index_parties_on_skill0_id"
|
||||||
t.index ["skill1_id"], name: "index_parties_on_skill1_id"
|
t.index ["skill1_id"], name: "index_parties_on_skill1_id"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue