lib/apartment/database.rb in apartment-0.19.0 vs lib/apartment/database.rb in apartment-0.20.0

- old
+ new

@@ -1,16 +1,17 @@ -require 'active_support/core_ext/module/delegation' +require 'forwardable' module Apartment # The main entry point to Apartment functions # module Database extend self + extend Forwardable - delegate :create, :current_database, :current, :drop, :process, :process_excluded_models, :reset, :seed, :switch, :to => :adapter + def_delegators :adapter, :create, :current_database, :current, :drop, :process, :process_excluded_models, :reset, :seed, :switch attr_writer :config # Initialize Apartment config options such as excluded_models # @@ -40,12 +41,12 @@ end end # Reset config and adapter so they are regenerated # - def reload! + def reload!(config = nil) Thread.current[:apartment_adapter] = nil - @config = nil + @config = config end private # Fetch the rails database configuration \ No newline at end of file