Release Notes: http://weblog.rubyonrails.org/2016/6/30/Rails-5-0-final
- Ruby 2.2.2+ required
- Sprockets 3
- API mode: If you create a new Rails application using rails new backend --api, you’ll get a slimmed down skeleton and configuration that assumes you’ll be working with JSON, not HTML. (outputs with .to_json by default but you can use your own, e.g. AMS, JSONAPI::Resources, etc)
- No more rake command! Its all Rails.
- OR! Finally! this is now a thing "Post.where(‘id = 1’).or(Post.where(‘id = 2’)) gives you exactly what you’d think!"
- New Attributes API by Sean Griffin - kind of like type casting your attributes but with a twist... " It will override the type of existing attributes if needed. This allows control over how values are converted to and from SQL when assigned to a model. It also changes the behavior of values passed to ActiveRecord::Base.where, which lets use our domain objects across much of Active Record, without having to rely on implementation details or monkey patching."
- Rails 5.0 also ships with Turbolinks 5 – the one with native iOS and Android wrapper implementations! Check out https://www.youtube.com/watch?v=SWEts0rlezA Sam Stephenson's RailsConf presentation on it, pretty rad.
- SQL statements are now coloured, no more requirements on another gem
- No more accidentally halting Active Record callbacks because the last statement is false. Now you throw(:abort) explicitly!
- ActiveRecord::Relation#in_batches makes it much easier to deal with record work in batches at a time to lessen memory overloads.
- ApplicationRecord has been born as a default parent class of all models created by the generators.
- XML Serialization is gone
- no more rake doc tasks