diff options
Diffstat (limited to 'railties/CHANGELOG.md')
-rw-r--r-- | railties/CHANGELOG.md | 422 |
1 files changed, 318 insertions, 104 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 2e7f134101..aa12708669 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,178 +1,392 @@ -* Specify dummy app's db migrate path in plugin's test_helper.rb. +* Make `static_index` part of the `config.public_file_server` config and + call it `public_file_server.index_name`. - Fixes #16877. + *Yuki Nishijima* - *Yukio Mizuta* +* Generated `Gemfile`s for new applications include a new dependency on + [listen](https://github.com/guard/listen) commented out. -* Inject `Rack::Lock` if `config.eager_load` is false. + *Puneet Agarwal* and *Xavier Noria* - Fixes #15089. +* Deprecate `serve_static_files` in favor of `public_file_server.enabled`. - *Xavier Noria* + Unifies the static asset options under `public_file_server`. -* Change the path of dummy app location in plugin's test_helper.rb for cases - you specify dummy_path option. + To upgrade, replace occurrences of: - *Yukio Mizuta* + ``` + config.serve_static_files = # false or true + ``` -* Fix a bug in the `gem` method for Rails templates when non-String options - are used. + in your environment files, with: - Fixes #16709. + ``` + config.public_file_server.enabled = # false or true + ``` - *Yves Senn* + *Kasper Timm Hansen* -* The [web-console](https://github.com/rails/web-console) gem is now - installed by default for new applications. It can help you debug - development exceptions by spawning an interactive console in its cause - binding. +* Deprecate `config.static_cache_control` in favor of + `config.public_file_server.headers`. - *Ryan Dao*, *Genadi Samokovarov*, *Guillermo Iguaran* + To upgrade, replace occurrences of: -* Add a `required` option to the model generator for associations + ``` + config.static_cache_control = 'public, max-age=60' + ``` - *Sean Griffin* + in your environment files, with: -* Add `after_bundle` callbacks in Rails templates. Useful for allowing the - generated binstubs to be added to version control. + ``` + config.public_file_server.headers = { + 'Cache-Control' => 'public, max-age=60' + } + ``` - Fixes #16292. + `config.public_file_server.headers` can set arbitrary headers, sent along when + a response is delivered. - *Stefan Kanev* + *Yuki Nishijima* -* Pull in the custom configuration concept from dhh/custom_configuration, which allows you to - configure your own code through the Rails configuration object with custom configuration: +* Route generator should be idempotent + running generators several times no longer require you to cleanup routes.rb - # config/environments/production.rb - config.x.payment_processing.schedule = :daily - config.x.payment_processing.retries = 3 - config.x.super_debugger = true + *Thiago Pinto* - These configuration points are then available through the configuration object: +* Allow passing an environment to `config_for`. - Rails.configuration.x.payment_processing.schedule # => :daily - Rails.configuration.x.payment_processing.retries # => 3 - Rails.configuration.x.super_debugger # => true + *Simon Eskildsen* - *DHH* +* Allow rake:stats to account for rake tasks in lib/tasks -* Scaffold generator `_form` partial adds `class="field"` for password - confirmation fields. + *Kevin Deisz* - *noinkling* +* Added javascript to update the URL on mailer previews with the currently + selected email format. Reloading the page now keeps you on your selected + format rather than going back to the default html version. -* Add `Rails::Application.config_for` to load a configuration for the current - environment. + *James Kerr* - # config/exception_notification.yml: - production: - url: http://127.0.0.1:8080 - namespace: my_app_production - development: - url: http://localhost:3001 - namespace: my_app_development +* Add fail fast to `bin/rails test` - # config/production.rb - Rails.application.configure do - config.middleware.use ExceptionNotifier, config_for(:exception_notification) - end + Adding `--fail-fast` or `-f` when running tests will interrupt the run on + the first failure: - *Rafael Mendonça França*, *DHH* + ``` + # Running: -* Deprecate `Rails::Rack::LogTailer` without replacement. + ................................................S......E - *Rafael Mendonça França* + ArgumentError: Wups! Bet you didn't expect this! + test/models/bunny_test.rb:19:in `block in <class:BunnyTest>' -* Add a generic --skip-gems options to generator + bin/rails test test/models/bunny_test.rb:18 - This option is useful if users want to remove some gems like jbuilder, - turbolinks, coffee-rails, etc that don't have specific options on the - generator. + ....................................F - rails new my_app --skip-gems turbolinks coffee-rails + This failed - *Rafael Mendonça França* + bin/rails test test/models/bunny_test.rb:14 -* Invalid `bin/rails generate` commands will now show spelling suggestions. + Interrupted. Exiting... - *Richard Schneeman* -* Add `bin/setup` script to bootstrap an application. + Finished in 0.051427s, 1808.3872 runs/s, 1769.4972 assertions/s. - *Yves Senn* + ``` -* Replace double quotes with single quotes while adding an entry into Gemfile. + Note that any unexpected errors don't abort the run. - *Alexander Belaev* + *Kasper Timm Hansen* -* Default `config.assets.digest` to `true` in development. +* Add inline output to `bin/rails test` - *Dan Kang* + Any failures or errors (and skips if running in verbose mode) are output + during a test run: -* Load database configuration from the first `database.yml` available in paths. + ``` + # Running: - *Pier-Olivier Thibault* + .....S..........................................F -* Reading name and email from git for plugin gemspec. + This failed - Fixes #9589. + bin/rails test test/models/bunny_test.rb:14 - *Arun Agrawal*, *Abd ar-Rahman Hamidi*, *Roman Shmatov* + .................................E -* Fix `console` and `generators` blocks defined at different environments. + ArgumentError: Wups! Bet you didn't expect this! + test/models/bunny_test.rb:19:in `block in <class:BunnyTest>' - Fixes #14748. + bin/rails test test/models/bunny_test.rb:18 - *Rafael Mendonça França* + .................... + + Finished in 0.069708s, 1477.6019 runs/s, 1448.9106 assertions/s. + ``` + + Output can be deferred to after a run with the `--defer-output` option. + + *Kasper Timm Hansen* + +* Fix displaying mailer previews on non local requests when config + `action_mailer.show_previews` is set + + *Wojciech Wnętrzak* + +* `rails server` will now honour the `PORT` environment variable + + *David Cornu* -* Move configuration of asset precompile list and version to an initializer. +* Plugins generated using `rails plugin new` are now generated with the + version number set to 0.1.0. - *Matthew Draper* + *Daniel Morris* -* Remove sqlite3 lines from `.gitignore` if the application is not using sqlite3. +* `I18n.load_path` is now reloaded under development so there's no need to + restart the server to make new locale files available. Also, I18n will no + longer raise for deleted locale files. - *Dmitrii Golub* + *Kir Shatrov* -* Add public API to register new extensions for `rake notes`. +* Add `bin/update` script to update development environment automatically. - Example: + *Mehmet Emin İNAÇ* - config.annotations.register_extensions("scss", "sass") { |tag| /\/\/\s*(#{tag}):?\s*(.*)$/ } +* Fix STATS_DIRECTORIES already defined warning when running rake from within + the top level directory of an engine that has a test app. - *Roberto Miranda* + Fixes #20510 -* Removed unnecessary `rails application` command. + *Ersin Akinci* - *Arun Agrawal* +* Make enabling or disabling caching in development mode possible with + rake dev:cache. -* Make the `rails:template` rake task load the application's initializers. + Running rake dev:cache will create or remove tmp/caching-dev.txt. When this + file exists config.action_controller.perform_caching will be set to true in + config/environments/development.rb. - Fixes #12133. + Additionally, a server can be started with either --dev-caching or + --no-dev-caching included to toggle caching on startup. + + *Jussi Mertanen*, *Chuck Callebs* + +* Add a `--api` option in order to generate plugins that can be added + inside an API application. *Robin Dupret* -* Introduce `Rails.gem_version` as a convenience method to return - `Gem::Version.new(Rails.version)`, suggesting a more reliable way to perform - version comparison. +* Fix `NoMethodError` when generating a scaffold inside a full engine. + + *Yuji Yaginuma* + +* Adding support for passing a block to the `add_source` action of a custom generator + + *Mike Dalton*, *Hirofumi Wakasugi* + +* `assert_file` understands paths with special characters + (eg. `v0.1.4~alpha+nightly`). + + *Diego Carrion* + +* Remove ContentLength middleware from the defaults. If you want it, just + add it as a middleware in your config. + + *Egg McMuffin* + +* Make it possible to customize the executable inside rerun snippets. + + *Yves Senn* + +* Add support for API only apps. + Middleware stack was slimmed down and it has only the needed + middleware for API apps & generators generates the right files, + folders and configurations. + + *Santiago Pastorino & Jorge Bejar* + +* Make generated scaffold functional tests work inside engines. + + *Yuji Yaginuma* + +* Generator a `.keep` file in the `tmp` folder by default as many scripts + assume the existence of this folder and most would fail if it is absent. + + See #20299. + + *Yoong Kang Lim*, *Sunny Juneja* + +* `config.static_index` configures directory `index.html` filename + + Set `config.static_index` to serve a static directory index file not named + `index`. E.g. to serve `main.html` instead of `index.html` for directory + requests, set `config.static_index` to `"main"`. + + *Eliot Sykes* + +* `bin/setup` uses built-in rake tasks (`log:clear`, `tmp:clear`). + + *Mohnish Thallavajhula* + +* Fix mailer previews with attachments by using the mail gem's own API to + locate the first part of the correct mime type. + + Fixes #14435. + + *Andrew White* + +* Remove sqlite support from `rails dbconsole`. + + *Andrew White* + +* Rename `railties/bin` to `railties/exe` to match the new Bundler executables + convention. + + *Islam Wazery* + +* Print `bundle install` output in `rails new` as soon as it's available. + + Running `rails new` will now print the output of `bundle install` as + it is available, instead of waiting until all gems finish installing. + + *Max Holder* + +* Respect `pluralize_table_names` when generating fixture file. + + Fixes #19519. + + *Yuji Yaginuma* + +* Add a new-line to the end of route method generated code. + + We need to add a `\n`, because we cannot have two routes + in the same line. + + *arthurnn* + +* Add `rake initializers`. + + This task prints out all defined initializers in the order they are invoked + by Rails. This is helpful for debugging issues related to the initialization + process. + + *Naoto Kaneko* + +* Created rake restart task. Restarts your Rails app by touching the + `tmp/restart.txt`. + + Fixes #18876. + + *Hyonjee Joo* + +* Add `config/initializers/active_record_belongs_to_required_by_default.rb`. + + Newly generated Rails apps have a new initializer called + `active_record_belongs_to_required_by_default.rb` which sets the value of + the configuration option `config.active_record.belongs_to_required_by_default` + to `true` when ActiveRecord is not skipped. + + As a result, new Rails apps require `belongs_to` association on model + to be valid. + + This initializer is *not* added when running `rake rails:update`, so + old apps ported to Rails 5 will work without any change. + + *Josef Šimánek* + +* `delete` operations in configurations are run last in order to eliminate + 'No such middleware' errors when `insert_before` or `insert_after` are added + after the `delete` operation for the middleware being deleted. + + Fixes #16433. + + *Guo Xiang Tan* + +* Newly generated applications get a `README.md` in Markdown. + + *Xavier Noria* + +* Remove the documentation tasks `doc:app`, `doc:rails`, and `doc:guides`. + + *Xavier Noria* + +* Force generated routes to be inserted into `config/routes.rb`. + + *Andrew White* + +* Don't remove all line endings from `config/routes.rb` when revoking scaffold. + + Fixes #15913. + + *Andrew White* + +* Rename `--skip-test-unit` option to `--skip-test` in app generator + + *Melanie Gilman* + +* Add the `method_source` gem to the default Gemfile for apps. + + *Sean Griffin* + +* Drop old test locations from `rake stats`: + + - test/functional + - test/unit + + *Ravil Bayramgalin* + +* Update `rake stats` to correctly count declarative tests + as methods in `_test.rb` files. + + *Ravil Bayramgalin* + +* Remove deprecated `test:all` and `test:all:db` tasks. + + *Rafael Mendonça França* + +* Remove deprecated `Rails::Rack::LogTailer`. + + *Rafael Mendonça França* + +* Remove deprecated `RAILS_CACHE` constant. + + *Rafael Mendonça França* + +* Remove deprecated `serve_static_assets` configuration. + + *Rafael Mendonça França* + +* Use local variables in `_form.html.erb` partial generated by scaffold. + + *Andrew Kozlov* + +* Add `config/initializers/callback_terminator.rb`. + + Newly generated Rails apps have a new initializer called + `callback_terminator.rb` which sets the value of the configuration option + `ActiveSupport.halt_callback_chains_on_return_false` to `false`. + + As a result, new Rails apps do not halt Active Record and Active Model + callback chains when a callback returns `false`; only when they are + explicitly halted with `throw(:abort)`. - Example: + The terminator is *not* added when running `rake rails:update`, so returning + `false` will still work on old apps ported to Rails 5, displaying a + deprecation warning to prompt users to update their code to the new syntax. - Rails.version #=> "4.1.2" - Rails.gem_version #=> #<Gem::Version "4.1.2"> + *claudiob* - Rails.version > "4.1.10" #=> false - Rails.gem_version > Gem::Version.new("4.1.10") #=> true - Gem::Requirement.new("~> 4.1.2") =~ Rails.gem_version #=> true +* Generated fixtures won't use the id when generated with references attributes. - *Prem Sichanugrist* + *Pablo Olmos de Aguilera Corradini* -* Avoid namespacing routes inside engines. +* Add `--skip-action-mailer` option to the app generator. - Mountable engines are namespaced by default so the generated routes - were too while they should not. + *claudiob* - Fixes #14079. +* Autoload any second level directories called `app/*/concerns`. - *Yves Senn*, *Carlos Antonio da Silva*, *Robin Dupret* + *Alex Robbin* -Please check [4-1-stable](https://github.com/rails/rails/blob/4-1-stable/railties/CHANGELOG.md) for previous changes. +Please check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/railties/CHANGELOG.md) for previous changes. |