amoeba-rb/amoeba ? reverse-engineered prompt
Reverse engineered prompt
Build me a Ruby gem for ActiveRecord that makes it easy to duplicate a record together with its related children. I want to be able to configure each model with a simple block so I can choose which associations get copied, which get left alone, and how certain fields should change when a copy is made, like prepending Copy of to a title or nullifying a value. It should work with common Rails associations like has many, has one through, has many through, and has and belongs to many, and it should support copying nested children too. Please make the main method feel like a normal dup replacement, so I can call something like amoeba_dup on a model and save the cloned copy. Also make sure it handles things like different copy modes, STI children, and custom field transforms in a clean way. If you need to check current Rails docs or best practices while building it, go ahead and look them up online.
Are you gonna build this?
make sure you review the code using coderabbit