hensei-api/app/blueprints/api/v1/grid_summon_blueprint.rb
Justin Edmund 8f77a1f613 Refactor grid blueprints
- **GridCharacterBlueprint:**
  - Removed `:minimal` view restriction on `party` association.
  - Improved nil checks for `ring1`, `ring2`, and `earring` to prevent errors.
  - Converted string values in `awakening_level`, `over_mastery`, and `aetherial_mastery` fields to integers for consistency.
  - Ensured `over_mastery` and `aetherial_mastery` only include valid entries, filtering out blank or zero-modifier values.

- **GridWeaponBlueprint:**
  - Removed `:minimal` view restriction on `party` association.
  - Ensured `weapon` association exists before accessing `ax`, `series`, or `awakening`.
  - Improved conditional checks for `weapon_keys` to prevent errors when `weapon` or `series` is nil.
  - Converted `awakening_level` field to integer for consistency.

- **GridCharacterBlueprint:**
  - Removed `:minimal` view restriction on `party` association.
2025-02-09 18:03:35 -08:00

31 lines
791 B
Ruby

# frozen_string_literal: true
module Api
module V1
class GridSummonBlueprint < ApiBlueprint
fields :main, :friend, :position, :quick_summon, :uncap_level, :transcendence_step
view :preview do
association :summon, name: :object, blueprint: SummonBlueprint
end
view :nested do
association :summon, name: :object, blueprint: SummonBlueprint, view: :full
end
view :full do
include_view :nested
association :party, blueprint: PartyBlueprint
end
view :uncap do
association :party, blueprint: PartyBlueprint
fields :position, :uncap_level, :transcendence_step
end
view :destroyed do
fields :main, :friend, :position, :created_at, :updated_at
end
end
end
end