![]() When changing Rails versions, it's best to move slowly, one minor version at a time, in order to make good use of the deprecation warnings. Upgrade to the latest Ruby you can first, and then upgrade Rails. It's a good idea to upgrade Ruby and Rails separately. Rails generally stays close to the latest released Ruby version when it's released: Do yourself a favor and make sure your test coverage is good before you start an upgrade. In the case of a Rails upgrade, that will mean every single piece of functionality in the application. If you don't have automated tests that exercise the bulk of your application, you'll need to spend time manually exercising all the parts that have changed. The best way to be sure that your application still works after upgrading is to have good test coverage before you start the process. You need to balance several factors: the need for new features, the increasing difficulty of finding support for old code, and your available time and skills, to name a few. Remove :cache and :concat options in asset helpers references in viewsīefore attempting to upgrade an existing application, you should be sure you have a good reason to upgrade.Active Record Observer and Action Controller Sweeper.Explicit block use for ActiveSupport::Callbacks.Methods defined in Active Record fixtures.Usage of return within inline callback blocks.Error handling in transaction callbacks.ActionController::Live became a Concern.ActiveSupport::TestCase Default Test Order is Now Random.Removed support for activerecord-deprecated_finders gem.Removed Support for protected_attributes Gem.ActionView::Helpers::RecordTagHelper moved to external gem (record_tag_helper).Added Wildcard Matching for Template Dependencies.protect_from_forgery Now Defaults to prepend: false.ActionController::Parameters No Longer Inherits from HashWithIndifferentAccess.Use bin/rails for running tasks and tests.Removed Support for Legacy mysql Database Adapter.Autoloading is Disabled After Booting in the Production Environment.ActiveJob Now Inherits from ApplicationJob by Default.Halting Callback Chains via throw(:abort).Active Record Models Now Inherit from ApplicationRecord by Default.Removed deprecated support of redirect_to :back.Removed deprecated support to :text and :nothing in render.crets now loaded with all keys as symbols.Top-level HashWithIndifferentAccess is soft-deprecated.Expiry in signed or encrypted cookie is now embedded in the cookies values.Active Storage assignment behavior change.ActionDispatch::Response#content_type now returns the Content-Type header without modification.All npm packages have been moved to the scope.Purpose and expiry metadata is now embedded inside signed and encrypted cookies for increased security.Active Storage now requires Image Processing.Redirection to HTTPS from HTTP will now use the 308 HTTP status code.The helper class method in controllers uses String#constantize.ActiveSupport::Callbacks#halted_callback_hook now receive a second argument.Response's Content-Type when using respond_to#any._for return value no longer supports access with String keys.Rails version is now included in the Active Record schema dump.Active Storage default variant processor changed to :vips.Active Storage video preview image generation.New ActiveSupport::Cache serialization format.Digest class for ActiveSupport::Digest changing to SHA256. ![]() Key generator digest class changing to use SHA256.ActionDispatch::Request#content_type now returns Content-Type header as it is.Ability to configure toload_once_paths.ActiveSupport::Dependencies private API has been deleted.Applications need to run in zeitwerk mode.Sprockets is now an optional dependency.ActionView::Helpers::UrlHelper#button_to changed behavior.DB types, network types, cidr, time based, interval, tsrange, timestamptz JSON querying, JSON operators The “right” indexes, indexing topics Views and materialized views Query planning, EXPLAIN Full text search Concurrency, auto-vacuum setups Tuning statistics collector for large tables DB triggers management hyperloglog type Query performance for array column Denormalization Partitioning Migrating a few big tables to their own database (functional sharding, or application level sharding), minimizing downtime CTEs within Active Record, Modern SQL dexter (automatic indexing) and HypoPG.I appreciated the responses! I’ve summarized them below. This tweet was more popular than I expected and got a lot of interesting replies. Hey Rails + #PostgreSQL devs, what’s one #PostgreSQL thing you wish you knew more about, that’s not covered deeply (or at all) in the Rails Guides? Thanks! I recently tweeted asking the following question.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |