moiristo / deep_cloneable

This gem gives every ActiveRecord::Base object the possibility to do a deep clone that includes user specified associations.
MIT License
785 stars 89 forks source link

Add support for Mongoid #143

Open kylejw2 opened 2 years ago

kylejw2 commented 2 years ago

Mongoid works very similar to ActiveRecord. I have an application with relationships between ActiveRecord models and Mongoid models. When an ActiveRecord model (with Mongoid models belonging to it) is cloned, I'd like to have the Mongoid models cloned as well.

moiristo commented 2 years ago

I've never used Mongoid myself, but the reflection on associations is probably a lot different? As I don't have any experience with it I won't be adding this, but PR's are welcome :) You could use the pre/postprocessor or block option to include these associations for now.