Sha256: de7e0f529424ee12f1ebf3dbf36691dccca3180858c8ef647f77779ba64717ab

Contents?: true

Size: 1.14 KB

Versions: 43

Compression:

Stored size: 1.14 KB

Contents

require 'rails/railtie'

module PlatformSdk
  class AssetSyncInitializer < Rails::Railtie
    initializer "platform_sdk.configure_asset_sync" do
      unless Rails.env.production?
        AssetSync.configure do |config|
          config.enabled = false
        end

        next
      end

      AssetSync.configure do |config|
        config.fog_provider = "AWS"
        config.fog_directory = "strongmind-cdn-prod"
        config.fog_region = "us-west-2"
        config.aws_iam_roles = true
      end

      Rails.application.config.active_record.dump_schema_after_migration = false

      Rails.application.config.action_controller.asset_host = "//strongmind-cdn-prod.s3.amazonaws.com"
      Rails.application.config.action_mailer.asset_host = "//strongmind-cdn-prod.s3.amazonaws.com"

      Rails.application.config.serve_static_files = true
      Rails.application.config.assets.compile = true
      Rails.application.config.assets.digest = true
      Rails.application.config.assets.enabled = true
      Rails.application.config.assets.initialize_on_precompile = true
      Rails.application.config.assets.prefix = "/#{ENV["NAMESPACE"]}/assets"
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
strongmind-platform-sdk-3.25.0 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.24.0 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.23.7 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.23.6 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.23.5 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.23.4 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.23.3 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.23.2 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.23.1 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.23.0 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.22.1 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.22.0 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.21.8 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.21.7 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.21.6 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.21.5 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.21.4 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.21.3 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.21.2 lib/platform_sdk/asset_sync_initializer.rb
strongmind-platform-sdk-3.21.1 lib/platform_sdk/asset_sync_initializer.rb