hensei-api/lib/post_deployment/test_mode_transaction.rb
Justin Edmund 5f1fafcc50 Made PostDeploymentManager modular
We broke PostDeploymentManager out into several files to make it easier to maintain.

We also added a "force" mode that forces the script to consider all CSV files. This is useful for testing the post-deploy script itself. This should only be used in test mode or you will dirty your database.

We also fine tuned some of the logging to make sure that both verbose and non-verbose modes are helpful.
2025-01-15 14:55:28 -08:00

25 lines
407 B
Ruby

# frozen_string_literal: true
module PostDeployment
class TestModeTransaction
def initialize
@changes = []
end
def add_change(model:, attributes:, operation:)
@changes << {
model: model,
attributes: attributes,
operation: operation
}
end
def rollback
@changes.clear
end
def committed_changes
@changes
end
end
end