Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
I've been thinking for a while it would be nice to have a way to swap from one adapter to another. This PR makes that easy. It is not super efficient about network calls, but that can be improved later. I wanted to start with easy and correct. Plus, this is something that should happen very rarely, so if it does a few extra network calls, it probably isn't a big deal.
redis_adapter = Flipper::Adapters::Redis.new active_record_adapter = Flipper::Adapters::ActiveRecord.new source = Flipper.new(redis_adapter) destination = Flipper.new(active_record_adapter) # wipes destination clean and copies features/gate values from source to it destination.import(source) # at this point destination == source
Previously it was only dealing with features in the adapter being used as the source of truth. Now all features in adapter are wiped first and then each individual feature is imported.