Closed fchampreux closed 5 years ago
Hello, thanks for your question!
deep_cloneable
doesn't save records; it generates a structure of duped records. How the record is saved is then up to you. I'd say that saving the duped record (and its associations) should already take place in a transaction, so I guess it's only needed to wrap everything in a transaction if you need to save multiple versions of those business rules at once.
Hi, I am planning to use deep_clonable to manage versions of business rules. As I work in an international environment, Business rules are translated, so that when creating a new version, all children translations must follow. A new version should not be created if all associated translations cannot be duplicated as well. That's why I am thinking of ActiveRecord transactions. Do you think this is feasible?