Merge pull request #36 from jedmund/party-details-upgrade

Add new fields to Parties
This commit is contained in:
Justin Edmund 2023-01-03 18:08:16 -08:00 committed by GitHub
commit 248a3df375
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 94 additions and 48 deletions

1
.ruby-gemset Normal file
View file

@ -0,0 +1 @@
granblue

View file

@ -71,7 +71,7 @@ GEM
activesupport (>= 3.2.5)
nokogiri (>= 1.5.2)
rspec (>= 3.1)
apipie-rails (0.8.2)
apipie-rails (0.9.0)
actionpack (>= 5.0)
activesupport (>= 5.0)
ast (2.4.2)
@ -79,9 +79,9 @@ GEM
activerecord (>= 4.0.0, < 7.1)
backport (1.2.0)
bcrypt (3.1.18)
benchmark (0.2.0)
benchmark (0.2.1)
blueprinter (0.25.3)
bootsnap (1.13.0)
bootsnap (1.15.0)
msgpack (~> 1.2)
builder (3.2.4)
byebug (11.1.3)
@ -96,9 +96,10 @@ GEM
activerecord (>= 5.a)
database_cleaner-core (~> 2.0.0)
database_cleaner-core (2.0.1)
date (3.3.3)
diff-lcs (1.5.0)
docile (1.4.0)
doorkeeper (5.6.0)
doorkeeper (5.6.2)
railties (>= 5)
dotenv (2.8.1)
dotenv-rails (2.8.1)
@ -107,18 +108,18 @@ GEM
e2mmap (0.1.0)
email_validator (2.2.4)
activemodel
erubi (1.11.0)
erubi (1.12.0)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
faker (3.0.0)
faker (3.1.0)
i18n (>= 1.8.11, < 2)
ffi (1.15.5)
figaro (1.2.0)
thor (>= 0.14.0, < 2)
gemoji (3.0.1)
gemoji (4.0.1)
gemoji-parser (1.3.1)
gemoji (>= 2.1.0)
globalid (1.0.0)
@ -126,7 +127,7 @@ GEM
i18n (1.12.0)
concurrent-ruby (~> 1.0)
jaro_winkler (1.5.4)
json (2.6.2)
json (2.6.3)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
@ -134,43 +135,47 @@ GEM
listen (3.7.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.19.0)
loofah (2.19.1)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mail (2.8.0)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.2)
method_source (1.0.0)
mini_mime (1.1.2)
mini_portile2 (2.6.1)
minitest (5.16.3)
mini_portile2 (2.8.1)
minitest (5.17.0)
msgpack (1.6.0)
net-imap (0.3.1)
net-imap (0.3.4)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.1.3)
net-protocol (0.2.1)
timeout
net-smtp (0.3.3)
net-protocol
nio4r (2.5.8)
nokogiri (1.12.5)
mini_portile2 (~> 2.6.1)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
oj (3.13.23)
parallel (1.22.1)
parser (3.1.2.1)
parser (3.2.0.0)
ast (~> 2.4.1)
pg (1.4.4)
pg (1.4.5)
pg_search (2.3.6)
activerecord (>= 5.2)
activesupport (>= 5.2)
psych (4.0.6)
psych (5.0.1)
stringio
puma (6.0.0)
puma (6.0.2)
nio4r (~> 2.0)
racc (1.6.0)
rack (2.2.4)
racc (1.6.2)
rack (2.2.5)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-test (2.0.2)
@ -192,8 +197,8 @@ GEM
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.4.3)
loofah (~> 2.3)
rails-html-sanitizer (1.4.4)
loofah (~> 2.19, >= 2.19.1)
railties (7.0.4)
actionpack (= 7.0.4)
activesupport (= 7.0.4)
@ -206,9 +211,9 @@ GEM
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
ffi (~> 1.0)
rdoc (6.4.0)
rdoc (6.5.0)
psych (>= 4.0.0)
regexp_parser (2.6.0)
regexp_parser (2.6.1)
responders (3.0.1)
actionpack (>= 5.0)
railties (>= 5.0)
@ -221,10 +226,10 @@ GEM
rspec-mocks (~> 3.12.0)
rspec-core (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)
rspec-support (~> 3.12.0)
rspec-mocks (3.12.0)
rspec-mocks (3.12.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.12.0)
rspec-rails (6.0.1)
@ -238,30 +243,30 @@ GEM
rspec-support (3.12.0)
rspec_junit_formatter (0.6.0)
rspec-core (>= 2, < 4, != 2.12.0)
rubocop (1.38.0)
rubocop (1.42.0)
json (~> 2.3)
parallel (~> 1.10)
parser (>= 3.1.2.1)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.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)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.23.0)
rubocop-ast (1.24.1)
parser (>= 3.1.1.0)
ruby-progressbar (1.11.0)
sdoc (2.4.0)
sdoc (2.5.0)
rdoc (>= 5.0)
shoulda-matchers (5.2.0)
shoulda-matchers (5.3.0)
activesupport (>= 5.2.0)
simplecov (0.21.2)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
solargraph (0.47.2)
solargraph (0.48.0)
backport (~> 1.2)
benchmark
bundler (>= 1.17.2)
@ -279,13 +284,13 @@ GEM
spring (4.1.0)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
stringio (3.0.2)
stringio (3.0.4)
thor (1.2.1)
tilt (2.0.11)
timeout (0.3.0)
timeout (0.3.1)
tzinfo (2.0.5)
concurrent-ruby (~> 1.0)
unicode-display_width (2.3.0)
unicode-display_width (2.4.0)
webrick (1.7.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)

View file

@ -33,7 +33,8 @@ module Api
end
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,
blueprint: RaidBlueprint
@ -63,7 +64,7 @@ module Api
include_view :characters
include_view :job_skills
fields :description, :extra
fields :description, :charge_attack, :button_count, :turn_count, :chain_count
end
view :collection do

View file

@ -105,7 +105,7 @@ module Api
def build_conditions(params)
unless params['recency'].blank?
start_time = (DateTime.current - params['recency'].to_i.seconds)
.to_datetime.beginning_of_day
.to_datetime.beginning_of_day
end
{}.tap do |hash|
@ -142,7 +142,14 @@ module Api
:skill0_id,
:skill1_id,
:skill2_id,
:skill3_id
:skill3_id,
:full_auto,
:auto_guard,
:charge_attack,
:clear_time,
:button_count,
:turn_count,
:chain_count
)
end
end

View file

@ -20,7 +20,7 @@ Bundler.require(*Rails.groups)
module HenseiApi
class Application < Rails::Application
# 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.
# Application configuration can go into files in config/initializers

View 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

View 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

View file

@ -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

View file

@ -0,0 +1,5 @@
class ChangeDefaultValueOnChargeAttack < ActiveRecord::Migration[7.0]
def change
change_column :parties, :charge_attack, :boolean, null: false, default: true
end
end

View file

@ -10,13 +10,12 @@
#
# 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
enable_extension "btree_gin"
enable_extension "pg_trgm"
enable_extension "pgcrypto"
enable_extension "plpgsql"
enable_extension "timescaledb"
create_table "characters", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
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.index ["party_id"], name: "index_grid_weapons_on_party_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
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 "skill3_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 ["skill0_id"], name: "index_parties_on_skill0_id"
t.index ["skill1_id"], name: "index_parties_on_skill1_id"