lib/combustion.rb in combustion-1.1.2 vs lib/combustion.rb in combustion-1.2.0

- old
+ new

@@ -10,22 +10,31 @@ mattr_accessor :path, :schema_format, :setup_environment self.path = "/spec/internal" self.schema_format = :ruby - MODULES = if Rails.version.to_f >= 3.1 - %w[ active_record action_controller action_view action_mailer sprockets ] - else - %w[ active_record action_controller action_view action_mailer ] - end + MODULES = begin + hash = { + :active_model => "active_model/railtie", + :active_record => "active_record/railtie", + :action_controller => "action_controller/railtie", + :action_mailer => "action_mailer/railtie", + :action_view => "action_view/railtie" + } + hash[:sprockets] = "sprockets/railtie" if Rails.version.to_f >= 3.1 + hash[:active_storage] = "active_storage/engine" if Rails.version.to_f >= 5.2 + + hash + end.freeze + def self.initialize!(*modules, &block) self.setup_environment = block if block_given? options = modules.extract_options! - modules = MODULES if modules == [:all] - modules.each { |mod| require "#{mod}/railtie" } + modules = MODULES.keys if modules == [:all] + modules.each { |mod| require MODULES[mod] } Bundler.require :default, Rails.env Combustion::Application.configure_for_combustion include_database modules, options @@ -63,10 +72,11 @@ config.include Capybara end end -require "combustion/application" require "combustion/configurations/action_controller" require "combustion/configurations/action_mailer" require "combustion/configurations/active_record" +require "combustion/configurations/active_storage" +require "combustion/application" require "combustion/database"