lib/ghost_adapter.rb in ghost_adapter-0.0.2 vs lib/ghost_adapter.rb in ghost_adapter-0.1.0
- old
+ new
@@ -6,12 +6,22 @@
def self.config
@@config ||= GhostAdapter::Config.new # rubocop:disable Style/ClassVars
end
def self.setup(options = {})
- @@config = GhostAdapter::Config.new(options) # rubocop:disable Style/ClassVars
+ new_config = GhostAdapter::Config.new(options)
+ if defined? @@config
+ @@config.merge!(new_config)
+ else
+ @@config = new_config # rubocop:disable Style/ClassVars
+ end
+
yield @@config if block_given?
+ end
+
+ def self.clear_config
+ @@config = GhostAdapter::Config.new # rubocop:disable Style/ClassVars
end
module Internal
@@ghost_migration_enabled = false # rubocop:disable Style/ClassVars