hensei-api/db/data/20231119051223_migrate_series.rb
Justin Edmund 00e5ec8c4b
API updates for Draconic Weapons Providence (#138)
* Make weapon key series an array

Draconic Weapons Providence can have original Draconic Weapon keys, but also have a new key that can only be equipped to them. Thanks, Cygames.

* Update weapon.rb

* Update to check key compatibility against an array instead of an int
* Add convenience function to check if the weapon is part of a Draconic Weapon series

* Update grid_weapon.rb

Update conflict detection to:
* Detect Draconic Weapons Providence
* Add multiple weapons to conflicting weapons instead of just one

* (WIP) Update conflict view rendering

Conflict blueprints should render multiple conflict weapons instead of just one.

Also adds Draconic Weapon Providence series to various places that check series by number

* Finish last bugs

We tested to ensure that conflict resolution appears for

* Opus and Draconic
* Draconic and Draconic 2
* Draconic 2 + Opus and Draconic 1
2023-12-26 03:21:06 -08:00

13 lines
270 B
Ruby

# frozen_string_literal: true
class MigrateSeries < ActiveRecord::Migration[7.0]
def up
WeaponKey.find_each do |weapon_key|
weapon_key.update(new_series: [weapon_key.series])
end
end
def down
raise ActiveRecord::IrreversibleMigration
end
end