Sha256: 0992884ebe3fe6c9261ccfc3e932b78d1de40f8443fc8f9630c69c003a15d2b3

Contents?: true

Size: 1.32 KB

Versions: 23

Compression:

Stored size: 1.32 KB

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'

module EacRailsBase0App
  class Application < Rails::Application
    module Production
      common_concern do
        next unless ::Rails.env.production?

        setup('assets', 'general', 'log', 'public_file_server')
      end

      module ClassMethods
        def setup_assets
          config.assets.js_compressor = :uglifier
          config.assets.compile = false
        end

        def setup_general
          config.active_record.dump_schema_after_migration = false
          config.cache_classes = true
          config.eager_load = false
          config.consider_all_requests_local = false
          config.action_controller.perform_caching = true
          config.read_encrypted_secrets = true
          config.action_mailer.perform_caching = false
          config.i18n.fallbacks = true
        end

        def setup_log
          config.log_level = :debug
          config.log_tags = [:request_id]
          config.active_support.deprecation = :notify
          config.log_formatter = ::Logger::Formatter.new
          config.logger = new_stdout_logger if ENV['RAILS_LOG_TO_STDOUT'].blank?
        end

        def setup_public_file_server
          config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
eac_rails_base0-0.60.4 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.60.3 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.60.2 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.60.1 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.60.0 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.59.0 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.58.0 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.57.0 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.56.0 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.55.3 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.55.2 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.55.1 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.55.0 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.54.0 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.53.0 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.52.3 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.52.2 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.52.1 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.52.0 lib/eac_rails_base0/app_base/application/production.rb
eac_rails_base0-0.51.0 lib/eac_rails_base0/app_base/application/production.rb