Skip to content

Commit

Permalink
Initialize config.assets.version the same way it's done in Sprockets
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Aug 8, 2011
1 parent eabc036 commit 8360d71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion actionpack/lib/sprockets/railtie.rb
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions railties/lib/rails/application/configuration.rb
Expand Up @@ -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
Expand Down

0 comments on commit 8360d71

Please sign in to comment.