Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Rails 5.1: What's New?

Rails 5.1: What's New?

An overview of Rails 5.1 features created for a presentation for our local Ruby user group.

Cliff Braton

June 19, 2017
Tweet

Other Decks in Programming

Transcript

  1. Other Removed Deprecations • Removed deprecated behavior that halts callbacks

    when the return is false. • Removed deprecated conditions parameter from #destroy_all and #delete_all. • Removed deprecated support of passing a class as a value in a query. • Now calling #to_hash on ActionController::Parameters results in an empty hash if you don't permit the values beforehand. • Removed support for non-keyword arguments in #process, #get, #post, #patch, #put, #delete, and #head for the ActionDispatch::IntegrationTest and ActionController::TestCase classes. • Similarly, other methods were converted from positional parameters to keyword arguments (#parameterize)
  2. Other Misc • Ruby 2.4 • ActiveRecord primary keys are

    now bigint instead of integer. • Way way faster ERB handler (Erubi) • has_many through must be below the association it's going through • New Builder-style syntax for HTML tags (tag.div, tag.br, etc.) • Inheriting directly from ActiveRecord::Migration raises an error. Specify the Rails version for which the migration was written for • Nested secret keys are now symbolized instead of strings. This is somewhat of a breaking change if you were previously depending on string keys.