xref #22701. xref #20612.
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
ToDo...
Rails API
ToDo...
Active Record attributes API
ToDo...
Test Runner
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 fromHashWithIndifferentAccess
. (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 insubmit_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 tothrow(: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 toreferences
while creating the table. (commit) -
New attributes API. (commit)
-
Add
:enum_prefix
/:enum_suffix
option toenum
definition. (Pull Request) -
Add
#cache_key
toActiveRecord::Relation
. (Pull Request) -
Add
ActiveRecord::Relation#outer_joins
. (Pull Request) -
Require
belongs_to
by default. (Pull Request) - Deprecaterequired
option in favor ofoptional
forbelongs_to
Active Model
Please refer to the Changelog for detailed changes.
Removals
- Removed XML serialization. This feature has been extracted into the activemodel-serializers-xml gem. (Pull Request)
Deprecations
- Deprecated returning
false
as a way to halt Active Model andActiveModel::Valdiations
callback chains. The recommended way is tothrow(:abort)
. (Pull Request)
Notable changes
- Validate multiple contexts on
valid?
andinvalid?
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
withConcurrent::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 returningfalse
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.