lib/departure/railtie.rb in departure-6.2.0 vs lib/departure/railtie.rb in departure-6.3.0

- old
+ new

@@ -4,25 +4,18 @@ module Departure class Railtie < Rails::Railtie railtie_name :departure - # It drops all previous database connections and reconnects using this - # PerconaAdapter. By doing this, all later ActiveRecord methods called in - # the migration will use this adapter instead of Mysql2Adapter. - # - # It also patches ActiveRecord's #migrate method so that it patches LHM - # first. This will make migrations written with LHM to go through the - # regular Rails Migration DSL. - initializer 'departure.configure_rails_initialization' do - ActiveSupport.on_load(:active_record) do - Departure.load - end - end - initializer 'departure.configure' do |app| Departure.configure do |config| config.tmp_path = app.paths['tmp'].first + end + end + + config.after_initialize do + Departure.configure do |dc| + ActiveRecord::Migration.uses_departure = dc.enabled_by_default end end end end