lib/fishplate.rb in fishplate-1.0.1 vs lib/fishplate.rb in fishplate-1.0.2

- old
+ new

@@ -38,18 +38,18 @@ def logger @logger ||= ::Logger.new(STDOUT) end def setup! - A9n.root.join('config/initializers').glob('*.rb').sort.each { |f| require f } - configure_active_record setup_database_tasks setup_db_connection + load_initializers + add_sidekiq_middleware if defined?(Sidekiq) end private @@ -74,9 +74,13 @@ def setup_db_connection ActiveRecord::Base.clear_active_connections! ActiveRecord::Base.flush_idle_connections! ActiveRecord::Base.establish_connection + end + + def load_initializers + A9n.root.join('config/initializers').glob('*.rb').sort.each { |f| require f } end def add_sidekiq_middleware Sidekiq.configure_server do |config| config.server_middleware do |chain|