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

Rails 5: awesome features and breaking changes

Claudio B.
September 26, 2015

Rails 5: awesome features and breaking changes

Presented at RailsClub in Moscow, September 2015
Video: https://www.youtube.com/watch?v=GbtepoRfH60

Links from this presentation:

------

Clean:

Remove deprecation code
http://github.com/rails/rails/pull/18325

Remove respond_to/respond_with placeholder methods
http://github.com/rails/rails/commit/afd5e9a

Remove XML Serialization
http://github.com/rails/rails/pull/21161

Remove content_tag_for, div_for
http://github.com/rails/rails/pull/18411

Remove skip_action_callback
http://github.com/rails/rails/pull/19060

Remove rake doc:* tasks
http://github.com/rails/rails/commit/cd7cc52

Remove render nothing: true
http://github.com/rails/rails/pull/20336

Remove from ActionController *_filter callbacks (use *_action)
http://github.com/rails/rails/commit/7644a99

------

Pack:

Require Ruby 2.2.2
http://github.com/rails/rails/pull/19753

Beyond Ludicrous Speed
http://github.com/rails/rails/pull/21057

AS::Dependencies 10x faster
http://github.com/rails/rails/pull/21411

Use #start_with? and #[] for speed
http://github.com/rails/rails/pull/21100

Reference string constants
http://github.com/rails/rails/pull/17173

Use keyword arguments
http://github.com/rails/rails/pull/18323

Replace alias_method_chain with Module#prepend
http://github.com/rails/rails/pull/19434

------

Unpack:

Type ‘rails command’, not ‘rake’
http://github.com/rails/rails/pull/18878

_🍔.html.erb is a valid partial file
http://github.com/rails/rails/commit/da9038e

Require belongs_to by default
http://github.com/rails/rails/pull/18937

Drop ActiveRecord::Relation#uniq
http://github.com/rails/rails/pull/20198

More uniform arguments for ActiveRecord::Relation methods
http://github.com/rails/rails/pull/11898
http://github.com/rails/rails/pull/21505

Allow true to validate acceptance
http://github.com/rails/rails/pull/18439

More reversible migration actions
http://github.com/rails/rails/pull/20018

Allow empty arrays in deep munge
http://github.com/rails/rails/pull/16924

Accept collections in fresh_when
http://github.com/rails/rails/pull/18374

------

Decorate:

Add ActiveRecord::Relation#or
http://github.com/rails/rails/pull/16052

Add ActiveModel::Errors#codes
http://github.com/rails/rails/pull/18322

Add Integer#positive?, negative?
http://github.com/rails/rails/commit/e54277a

Add prev_weekday, next_weekday, weekend? to Date and DateTime
http://github.com/rails/rails/pull/18335

Add Method#source_code
http://github.com/rails/rails/pull/18473

Add forever-cache for static pages
http://github.com/rails/rails/pull/18394

Add AR::Base.has_secure_token
http://github.com/rails/rails/pull/18217

Add ActionController::Renderer
http://github.com/rails/rails/pull/18546

Add 'rake dev:cache'
http://github.com/rails/rails/pull/20961

------

Housewarm:

Returning false in callbacks no longer halts callback chains
http://github.com/rails/rails/pull/17227

ActionController::Parameters no longer inherits from HashWithIndifferentAccess
http://github.com/rails/rails/pull/20868

PredicateBuilder no longer accepts Class in conditions
http://github.com/rails/rails/pull/17916

Time columns are now time-zone aware by default
http://github.com/rails/rails/pull/15726

Claudio B.

September 26, 2015
Tweet

More Decks by Claudio B.

Other Decks in Programming

Transcript

  1. Rails 1.x Rails 5.x Rails 4.x Rails 3.x Rails 2.x

    Rails 0.x Releasing a major version ≈ Moving to a new place
  2. Releasing a major version ≈ Moving to a new place

    pack grow housewarm decorate unpack clean
  3. pack grow housewarm decorate unpack clean Remove deprecation code Remove

    respond_to/respond_with placeholder methods Remove XML Serialization Remove content_tag_for, div_for Remove skip_action_callback Remove rake doc:* tasks Remove render nothing: true Remove from ActionController *_filter callbacks (use *_action) #18325 afd5e9a #21161 #18411 #19060 cd7cc52 #20336 7644a99
  4. pack grow housewarm decorate unpack clean Require Ruby 2.2.2 Beyond

    Ludicrous Speed AS::Dependencies 10x faster Use #start_with? and #[] for speed Reference string constants Use keyword arguments Replace alias_method_chain with Module#prepend #19753 #21057 #21411 #21100 #18323 #17173 #19434
  5. pack grow housewarm decorate unpack clean More uniform arguments for

    ActiveRecord::Relation methods Drop ActiveRecord::Relation#uniq Allow empty arrays in deep munge Require belongs_to by default Allow true to validate acceptance More reversible migration actions Accept collections in fresh_when Type ‘rails command’, not ‘rake’ _.html.erb is a valid partial file #11898 #16924 #18937 #18439 #18374 #18878 #21505 #20198 #20018 da9038e
  6. pack grow housewarm decorate unpack clean Add ActiveRecord::Relation#or Add ActiveModel::Errors#codes

    Add Integer#positive?, negative? Add prev_weekday, next_weekday, weekend? to Date and DateTime Add Method#source_code Add forever-cache for static pages Add AR::Base.has_secure_token Add ActionController::Renderer Add ‘rake dev:cache’ #16052 e54277a #18335 #18473 #18217 #18546 #18322 #18394 #20961
  7. pack grow housewarm decorate unpack clean Returning false in callbacks

    no longer halts callback chains ActionController::Parameters no longer inherits from HashWithIndifferentAccess PredicateBuilder no longer accepts Class in conditions Time columns are now time-zone aware by default #17227 #20868 #17916 #15726
  8. pack grow housewarm decorate unpack clean Rails API! ActionCable! New

    Turbolinks! New Sprockets! Exciting future! Thanks!