A flexible gem for cloning models
A flexible gem for cloning your models. Clowne focuses on ease of use and provides the ability to connect various ORM adapters.
Read Evil Martians Chronicles to learn about possible use cases.
Clowne is built by Evil Martians, an American design and engineering consultancy for developer tools, AI, and cybersecurity startups.
To install Clowne with RubyGems:
gem install clowneOr add this line to your application's Gemfile:
gem "clowne"Assume that you have the following model:
class User
operation = UserCloner.call(user, email: "[email protected]")
# =>
operation.to_record
# =>
operation.persist!
# => true
cloned = operation.to_record
# =>
cloned.login
# => nil
cloned.email
# => "fake@example.com"
# associations:
cloned.posts.count == user.posts.count
# => true
cloned.profile.name
# => nilTake a look at our documentation for more info!
| Adapter | 1:1 | *:1 | 1:M | M:M |
|---|---|---|---|---|
| Active Record | has_one | belongs_to | has_many | has_and_belongs_to |
| Sequel | one_to_one | - | one_to_many | many_to_many |
The gem is available as open source under the terms of the MIT License.
No open issues yet, or sync has not completed.