Skip to content

Commit 5f57d25

Browse files
vipulnswardmorgoth
andauthored
Import TWIR 01/10/2025 (#434)
* Import TWIR * Spacing * changes * changes * Apply suggestions from code review Co-authored-by: Wojciech Wnętrzak <[email protected]> --------- Co-authored-by: Wojciech Wnętrzak <[email protected]>
1 parent 0332320 commit 5f57d25

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
---
2+
layout: post
3+
title: "Sorted Columns in Schema Dumper, Deprecations, and lots of fixes!"
4+
categories: news
5+
author: vipulnsward
6+
og_image: assets/images/this-week-in-rails.png
7+
published: true
8+
date: 2025-01-10
9+
---
10+
11+
Hey everyone, Happy Friday!
12+
13+
[Vipul](https://www.saeloun.com/team/vipul) here with the latest updates for This Week in Rails.
14+
15+
Before we start, a small update - I am happy to share that my team at Saeloun is joining the Rails Foundation as a contributing member.
16+
Read more about the reasons why we decided to join [here](https://rubyonrails.org/2025/1/10/saeloun-joins-rails-foundation), and why you should too!
17+
18+
[Colorize console prompt on non standard environments](https://github.com/rails/rails/pull/53027)
19+
Currently, the Rails console prompt is colored according to the following rules: blue for dev and test, red of prod.
20+
On non-standard environments (like staging), the prompt is not colored. With this change, it will now be set to Magenta, for these environments.
21+
22+
[Fix running individual app:update commands](https://github.com/rails/rails/pull/54098)
23+
This change fixes a regression, where the individual `app:update` commands (like `app:update:configs` or `app:update:bin`) could no longer be run on their own,
24+
as they require the app to be loaded and it no longer was.
25+
26+
[Fix backtrace of ArgumentErrors raised during template rendering](https://github.com/rails/rails/pull/54133)
27+
Before this fix, any argument error in a template with strict locals would be swallowed and be replaced by an exception with unrelated backtrace,
28+
which made debugging templates difficult.
29+
With this change, any `ArgumentError` unrelated to strict locals is re-raised, preserving the original backtrace for developers.
30+
31+
[Fix local variable access in layouts](https://github.com/rails/rails/pull/54020)
32+
Layouts now have access to local variables passed to `render`.
33+
This fixes a very old regression introduced in Rails 5.1!
34+
35+
[Sort table columns by name when dumping schema](https://github.com/rails/rails/pull/53281)
36+
The table columns inside `schema.rb` are now sorted alphabetically.
37+
Previously they'd be sorted by creation order, which can cause merge conflicts when two branches modify the same table concurrently.
38+
39+
[Update NotificationAssertions's assert_notifcation to match against payload subsets and return matched notification](https://github.com/rails/rails/pull/54126)
40+
`ActiveSupport::Testing::NotificationAssertions`'s `assert_notification` now matches against payload subsets by default.
41+
42+
Previously the following assertion would fail due to excess key values in the notification payload. Now with payload subset matching, it will pass.
43+
44+
```ruby
45+
assert_notification("post.submitted", title: "Cool Post") do
46+
ActiveSupport::Notifications.instrument("post.submitted", title: "Cool Post", body: "Cool Body")
47+
end
48+
```
49+
50+
Additionally, you can now persist a matched notification for more customized assertions.
51+
52+
```ruby
53+
notification = assert_notification("post.submitted", title: "Cool Post") do
54+
ActiveSupport::Notifications.instrument("post.submitted", title: "Cool Post", body: Body.new("Cool Body"))
55+
end
56+
assert_instance_of(Body, notification.payload[:body])
57+
```
58+
59+
[Load configured Active Storage plugins during boot](https://github.com/rails/rails/pull/45100)
60+
Previously, the parts of Active Storage using `ruby-vips`, `mini_magick`, or `image_processing` would try to load gems only when used.
61+
This strategy works well because it allows apps that don't need these features to easily ignore them and not have to depend on gems they don't need.
62+
63+
However, the downsides to this strategy was that it requires loading code during requests and that it moves potential error messages into request
64+
logs instead of those errors being immediately visible on boot.
65+
66+
[Introduce RAILS_MASTER_KEY placeholder to CI template](https://github.com/rails/rails/pull/52230)
67+
The existing CI templates do not work as expected if custom credentials are utilized, or if `config.require_master_key` is enabled.
68+
This change introduces `RAILS_MASTER_KEY` placeholder in generated `ci.yml` files, to address this issue.
69+
70+
[Don't load ActiveStorage::Blob when validating the service](https://github.com/rails/rails/pull/54142)
71+
For tasks like `assets:precompile` that don't need it, we should not be loading the entire ActiveStorage code, and instead just relevant parts.
72+
73+
[Use the given form in html_options for the hidden field in collection_check_boxes](https://github.com/rails/rails/pull/51746)
74+
Respect `html_options[:form]` when `collection_checkboxes` generates the hidden `<input>`.
75+
76+
[Deprecate String#mb_chars and AS::Multibyte::Chars](https://github.com/rails/rails/pull/54081)
77+
These APIs are a relic of the Ruby 1.8 days when Ruby strings weren't encoding aware.
78+
79+
[Deprecate ActiveSupport::Configurable](https://github.com/rails/rails/pull/53970)
80+
This was only used once internally by Rails, and is now deprecated going ahead.
81+
82+
83+
_You can view the whole list of changes [here](https://github.com/rails/rails/compare/@%7B2025-01-04%7D...main@%7B2025-01-10%7D)._
84+
85+
_We had [30 contributors](https://contributors.rubyonrails.org/contributors/in-time-window/20250104-20250110) to the Rails codebase this past week!_
86+
87+
Until next time!
88+
89+
_[Subscribe](https://world.hey.com/this.week.in.rails) to get these updates mailed to you._

0 commit comments

Comments
 (0)