Ruby on Rails 5.2 Release Notes

Highlights in Rails 5.2:

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.

Chapters

  1. Upgrading to Rails 5.2
  2. Major Features
  3. Railties
  4. Action Cable
  5. Action Pack
  6. Action View
  7. Action Mailer
  8. Active Record
  9. Active Model
  10. Active Support
  11. Active Job
  12. Ruby on Rails Guides
  13. Credits

1 Upgrading to Rails 5.2

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 5.1 in case you haven't and make sure your application still runs as expected before attempting an update to Rails 5.2. A list of things to watch out for when upgrading is available in the Upgrading Ruby on Rails guide.

2 Major Features

2.1 Active Storage

Pull Request

Active Storage facilitates uploading files to a cloud storage service like Amazon S3, Google Cloud Storage, or Microsoft Azure Storage and attaching those files to Active Record objects. It comes with a local disk-based service for development and testing and supports mirroring files to subordinate services for backups and migrations. You can read more about Active Storage in the Active Storage Overview guide.

2.2 Redis Cache Store

Pull Request

Rails 5.2 ships with built-in Redis cache store. You can read more about this in the Caching with Rails: An Overview guide.

2.3 HTTP/2 Early Hints

Pull Request

Rails 5.2 supports HTTP/2 Early Hints. To start the server with Early Hints enabled pass --early-hints to bin/rails server.

2.4 Credentials

Pull Request

Added config/credentials.yml.enc file to store production app secrets. It allows saving any authentication credentials for third-party services directly in repository encrypted with a key in the config/master.key file or the RAILS_MASTER_KEY environment variable. This will eventually replace Rails.application.secrets and the encrypted secrets introduced in Rails 5.1. Furthermore, Rails 5.2 opens API underlying Credentials, so you can easily deal with other encrypted configurations, keys, and files. You can read more about this in the Securing Rails Applications guide.

2.5 Content Security Policy

Pull Request

Rails 5.2 ships with a new DSL that allows you to configure a Content Security Policy for your application. You can configure a global default policy and then override it on a per-resource basis and even use lambdas to inject per-request values into the header such as account subdomains in a multi-tenant application. You can read more about this in the Securing Rails Applications guide.

3 Railties

Please refer to the Changelog for detailed changes.

3.1 Deprecations

3.2 Notable changes

4 Action Cable

Please refer to the Changelog for detailed changes.

4.1 Removals

4.2 Notable changes

5 Action Pack

Please refer to the Changelog for detailed changes.

5.1 Removals

5.2 Deprecations

5.3 Notable changes

6 Action View

Please refer to the Changelog for detailed changes.

6.1 Removals

6.2 Deprecations

6.3 Notable changes

7 Action Mailer

Please refer to the Changelog for detailed changes.

7.1 Notable changes

8 Active Record

Please refer to the Changelog for detailed changes.

8.1 Removals

8.2 Deprecations

8.3 Notable changes

9 Active Model

Please refer to the Changelog for detailed changes.

9.1 Notable changes

10 Active Support

Please refer to the Changelog for detailed changes.

10.1 Removals

10.2 Deprecations

10.3 Notable changes

11 Active Job

Please refer to the Changelog for detailed changes.

11.1 Notable changes

12 Ruby on Rails Guides

Please refer to the Changelog for detailed changes.

12.1 Notable changes

13 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.