# frozen_string_literal: true

require_relative 'boot'

require 'rails'
# Pick the frameworks you want:
require 'active_model/railtie'
require 'active_job/railtie'
require 'active_record/railtie'
require 'action_controller/railtie'
require 'action_mailer/railtie'
require 'action_view/railtie'
require 'action_cable/engine'
require 'sprockets/railtie'
# require "rails/test_unit/railtie"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Phoenix
  class Application < Rails::Application
    config.generators do |generate|
      generate.assets false
      generate.helper false
    end

    config.version = (ENV["GIT_TAG"].present?) ? ENV["GIT_TAG"] : "Development"

    # config.autoload_paths += %W[#{config.root}/lib]

    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 6.0
    # config.autoloader = :classic

    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Don't generate system test files.
    config.generators.system_tests = nil
    config.action_view.embed_authenticity_token_in_remote_forms = true
    config.action_mailer.raise_delivery_errors = false
    # config.middleware.use Rack::Attack

    # Logging config for Docker
    logger           = ActiveSupport::Logger.new($stdout)
    logger.formatter = config.log_formatter
    config.logger    = ActiveSupport::TaggedLogging.new(logger)
  end
end
