提交 8360d719 编写于 作者: S Santiago Pastorino

Initialize config.assets.version the same way it's done in Sprockets

上级 eabc0364
......@@ -20,7 +20,7 @@ class Railtie < ::Rails::Railtie
app.assets = Sprockets::Environment.new(app.root.to_s) do |env|
env.static_root = File.join(app.root.join('public'), config.assets.prefix)
env.logger = ::Rails.logger
env.version = ::Rails.env + '-' + config.assets.version
env.version = ::Rails.env + "#{'-' + config.assets.version if config.assets.version.present?}"
if config.assets.cache_store != false
env.cache = ActiveSupport::Cache.lookup_store(config.assets.cache_store) || ::Rails.cache
......
......@@ -37,6 +37,7 @@ def initialize(*)
@assets.paths = []
@assets.precompile = [ /\w+\.(?!js|css).+/, /application.(css|js)$/ ]
@assets.prefix = "/assets"
@assets.version = ''
@assets.cache_store = [ :file_store, "#{root}/tmp/cache/assets/" ]
@assets.js_compressor = nil
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册