Skip to content

Commit

Permalink
config.assets.enabled is now true by default
Browse files Browse the repository at this point in the history
  • Loading branch information
dhh committed Jan 5, 2013
1 parent fada87e commit 201f8d7
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
6 changes: 6 additions & 0 deletions railties/CHANGELOG.md
@@ -1,5 +1,11 @@
## Rails 4.0.0 (unreleased) ##

* config.assets.enabled is now true by default. If you're upgrading from a Rails 3.x app
that does not use the asset pipeline, you'll be required to add `config.assets.enabled = false`
to your application.rb. If you don't want the asset pipeline on a new app use --skip-sprockets

*DHH*

* Environment name can be a start substring of the default environment names
(production, development, test). For example: tes, pro, prod, dev, devel.
Fix #8628.
Expand Down
4 changes: 2 additions & 2 deletions railties/lib/rails/application/configuration.rb
Expand Up @@ -48,12 +48,12 @@ def initialize(*)
@secret_key_base = nil

@assets = ActiveSupport::OrderedOptions.new
@assets.enabled = false
@assets.enabled = true
@assets.paths = []
@assets.precompile = [ Proc.new { |path, fn| fn =~ /app\/assets/ && !%w(.js .css).include?(File.extname(path)) },
/(?:\/|\\|\A)application\.(css|js)$/ ]
@assets.prefix = "/assets"
@assets.version = ''
@assets.version = '1.0'
@assets.debug = false
@assets.compile = true
@assets.digest = false
Expand Down
Expand Up @@ -31,12 +31,9 @@ class Application < Rails::Application
# like if you have constraints or database-specific column types.
# config.active_record.schema_format = :sql

<% unless options.skip_sprockets? -%>
# Enable the asset pipeline.
config.assets.enabled = true
# Version of your assets, change this if you want to expire all your assets.
config.assets.version = '1.0'
<% if options.skip_sprockets? -%>
# Disable the asset pipeline.
config.assets.enabled = false
<% end -%>
end
end
Expand Up @@ -32,6 +32,9 @@

# Generate digests for assets URLs.
config.assets.digest = true

# Version of your assets, change this if you want to expire all your assets.
config.assets.version = '1.0'
<%- end -%>

# Specifies the header that your server uses for sending files.
Expand Down
1 change: 0 additions & 1 deletion railties/test/generators/app_generator_test.rb
Expand Up @@ -56,7 +56,6 @@ def test_assets
assert_file "app/views/layouts/application.html.erb", /stylesheet_link_tag\s+"application"/
assert_file "app/views/layouts/application.html.erb", /javascript_include_tag\s+"application"/
assert_file "app/assets/stylesheets/application.css"
assert_file "config/application.rb", /config\.assets\.enabled = true/
end

def test_invalid_application_name_raises_an_error
Expand Down

0 comments on commit 201f8d7

Please sign in to comment.