1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/guides/source/5_0_release_notes.md
2015-12-22 10:03:14 +01:00

7.2 KiB

DO NOT READ THIS FILE ON GITHUB, GUIDES ARE PUBLISHED ON http://guides.rubyonrails.org.

Ruby on Rails 5.0 Release Notes

Highlights in Rails 5.0:

  • Action Cable
  • Rails API
  • Active Rcord Attributes API
  • Test Runner
  • Exclusive use of rails CLI over Rake
  • Sprockets 3
  • Turbolinks 5
  • Ruby 2.2.2+ required

These release notes cover only the major changes. To learn about various bug fixes and changes, please refer to the change logs or check out the list of commits in the main Rails repository on GitHub.


Upgrading to Rails 5.0

If you're upgrading an existing application, it's a great idea to have good test coverage before going in. You should also first upgrade to Rails 4.2 in case you haven't and make sure your application still runs as expected before attempting an update to Rails 5.0. A list of things to watch out for when upgrading is available in the Upgrading Ruby on Rails guide.

Major Features

Action Cable

Pull Request

ToDo...

Rails API

Pull Request

ToDo...

Active Record attributes API

ToDo...

Test Runner

Pull Request

ToDo...

Railties

Please refer to the Changelog for detailed changes.

Removals

  • Removed debugger supprt use byebug instead. debugger is not supported by Ruby 2.2. (commit)

Deprecations

Notable changes

  • Remove Rack::ContentLength middleware from the default stack. (Commit)

  • Improved test runner. (Pull Request)

Action Pack

Please refer to the Changelog for detailed changes.

Removals

  • Removed ActionDispatch::Request::Utils.deep_munge. (commit)

Deprecations

Notable changes

  • Make ActionController::Parameters no longer inherits from HashWithIndifferentAccess. (Pull Request)

Action View

Please refer to the Changelog for detailed changes.

Removals

Deprecations

Notable Changes

  • Support explicit definition of resouce name for collection caching. (Pull Request)

  • Make disable_with default in submit_tag. (Pull Request)

Action Mailer

Please refer to the Changelog for detailed changes.

Removals

Deprecations

Notable changes

Active Record

Please refer to the Changelog for detailed changes.

Removals

Deprecations

  • Deprecated returning false as a way to halt Active Record callback chains. The recommended way is to throw(:abort). (Pull Request)

  • Synchronize behavior of #tables. (Pull Request)

  • Deprecate connection.tables on the SQLite3 and MySQL adapters.

  • Deprecate passing arguments to #tables - the #tables method of some adapters (mysql2, sqlite3) would return both tables and views while others (postgresql) just return tables. To make their behavior consistent, #tables will return only tables in the future.

  • Deprecate table_exists? - The #table_exists? method would check both tables and views. To make their behavior consistent with #tables, #table_exists? will check only tables in the future.

Notable changes

  • Add a foreign_key option to references while creating the table. (commit)

  • New attributes API. (commit)

  • Add :enum_prefix/:enum_suffix option to enum definition. (Pull Request)

  • Add #cache_key to ActiveRecord::Relation. (Pull Request)

  • Add ActiveRecord::Relation#outer_joins. (Pull Request)

  • Require belongs_to by default. (Pull Request) - Deprecate required option in favor of optional for belongs_to

Active Model

Please refer to the Changelog for detailed changes.

Removals

Deprecations

  • Deprecated returning false as a way to halt Active Model and ActiveModel::Valdiations callback chains. The recommended way is to throw(:abort). (Pull Request)

Notable changes

  • Validate multiple contexts on valid? and invalid? at once. (Pull Request)

Active Job

Please refer to the Changelog for detailed changes.

Removals

Deprecations

Notable changes

Active Support

Please refer to the Changelog for detailed changes.

Removals

Deprecations

  • Replace ActiveSupport::Concurrency::Latch with Concurrent::CountDownLatch from concurrent-ruby. (Pull Request)

Notable changes

  • New config option config.active_support.halt_callback_chains_on_return_false to specify whether ActiveRecord, ActiveModel and ActiveModel::Validations callback chains can be halted by returning false in a 'before' callback. (Pull Request)

Credits

See the full list of contributors to Rails for the many people who spent many hours making Rails, the stable and robust framework it is. Kudos to all of them.