Friday, May 17, 2024

Start of Rails 8 development, 7.0.8.2 & 7.1.3.3 released, Kamal by default, and lots more!

Posted by vipulnsward

Hey everyone, Happy Friday!

Vipul here with the latest updates for This Week in Rails. Let’s dive in.

Development of Rails 8.0 starts now πŸŽ‰
This week marks the official start of Rails 8.0 development. Stay tuned for more updates on Rails 8.0 features and changes ahead πŸŽ‰.

Rails 8 will target Ruby 3.3+ only for new apps

Add Kamal by default to Rails 8
This PR adds Kamal for deployment by default, which includes generating a Rails-specific config/deploy.yml. This can be skipped using --skip-kamal. Check out more about Kamal on its official site.

Add support for :if_not_exists and :force options to create_schema
This change adds missing support for :if_not_exists and :force options to create_schema.

7.0.8.2 and 7.1.3.3 have been released
Two new Rails version have been released upgrading Trix to 2.1.1 to fix CVE-2024-34341

Check here for more details - XSS Vulnerabilities in Trix Editor

Fix ActiveRecord::Relation#touch_all with custom attribute aliased as attribute for update
Before this change if we had something like

create_table :users do |t|
  t.timestamp :legacy_updated_at
end

class User < ActiveRecord::Base
  alias_attribute :updated_at, :legacy_updated_at
end

User.touch_all(:updated_at)

then ActiveRecord would not resolve updated_at to its alias correctly and resulted to a query that updates the same column twice. This PR fixes the behavior to correctly resolve the alias.

Support duration in ActiveSupport::XmlMini
Before this change ActiveSupport::XmlMini could not handle duration type in XML, which is one of the primitive data type. This PR adds support for duration type using ActiveSupport::Duration.

Support touch_all in batches
This change adds support for touch_all in batches. This is similarly supported for update_all/delete_all/etc)

  Post.in_batches.touch_all

You can view the whole list of changes here.
We had 27 contributors to the Rails codebase this past week!

Until next time!

Subscribe to get these updates mailed to you.