kaspth / oaken

A fresh blended alternative to Fixtures & FactoryBot for dev and test data.
MIT License
201 stars 6 forks source link

Wrap each seed file load in a transaction #62

Closed kaspth closed 1 year ago

kaspth commented 1 year ago

Prevents partially applied data from being stuck in the database.

I'm still not sure what changes we'd need for multi-db setups. For now I've added a transaction delegation, so users can do:

users.create name: "Something"

table_on_secondary_database.transaction do
  table_on_secondary_database.create name: "Something"
end