mitre / vulcan

A web application to streamline the development of STIGs from SRGs
https://mitre-vulcan-prod.herokuapp.com/
Other
60 stars 16 forks source link

Properly using #dup method for expected behavior: #522

Closed vanessuniq closed 1 year ago

vanessuniq commented 1 year ago
* Before: dup method was applied to a list of ActiveRecord objects, which was making a shallow copy of the array without creating new records for the objects within the array. So e.g: assigning a list of checks [belonging to rule B] to rule A disassociate the checks from rule B, updating the foreign key to rule A id.
* Fix: updated the logic to get the list of duplicated [new records] activeRecord model objects `map(&:dup)`.

Signed-off-by: Vanessa Fotso vfotso@mitre.org