Skip to content

Commit

Permalink
Update to public_file_server for Rails 5.0
Browse files Browse the repository at this point in the history
On Rails 5.0 the option now is called `public_file_server.enabled` (see
 rails/rails@fa2c96b).

Update Changelog link from `pull/13` to `pull/16`.

Update README to include Rails 5 [skip ci]
  • Loading branch information
jonatack committed Nov 6, 2015
1 parent 5722be1 commit 4c187a8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,8 @@

## Master

- Added support for Rails 5.0 [#16](https://github.com/heroku/rails_serve_static_assets/pull/16)

## [0.0.4] - 2015-01-29

- Reduce gem size on disk closes [#13](https://github.com/heroku/rails_serve_static_assets/issues/13)
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -6,6 +6,7 @@ Supports:

- Rails 3
- Rails 4
- Rails 5

## What

Expand Down
5 changes: 4 additions & 1 deletion lib/rails_serve_static_assets/railtie.rb
@@ -1,7 +1,10 @@
module RailsServeStaticAssets
class Railtie < Rails::Railtie
config.before_initialize do
if Rails.version >= "4.2.0"
version = Rails.version
if version >= "5.0.0"
::Rails.configuration.public_file_server.enabled = true
elsif version >= "4.2.0"
::Rails.configuration.serve_static_files = true
else
::Rails.configuration.serve_static_assets = true
Expand Down

0 comments on commit 4c187a8

Please sign in to comment.