0

Added fixture method and bugfixes

 2 months ago
source link: https://rubyonrails.org/2024/3/1/this-week-in-rails
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Friday, March 1, 2024

Added fixture method and bugfixes

Posted by Wojtek

Hi, Wojtek from this side. Let’s explore this week’s few changes in the Rails codebase.

Rails security update releases
Rails Versions 6.1.7.7, 7.0.8.1, and 7.1.3.2 have been released last week which contain fixes for security issues.

Expose a generic “fixture” method in tests
To avoid conflicting methods, in example with Minitest, it is possible now to load fixtures like this:

assert_equal "Ruby on Rails", web_sites(:rubyonrails).name
assert_equal "Ruby on Rails", fixture(:web_sites, :rubyonrails).name

Introduce assert_initializer
Compliments the existing initializer generator action.

Set default_url_options values in development/test environments
Prior to this commit, new Rails applications would raise ActionView::Template::Error if a mailer included a url built with a *_path helper.

Fix error message for not derived foreign key in Active Record
Using query_constraints method with a single non-primary-key column used to raise as expected, but with an incorrect error message. This has been fixed to raise with a more appropriate error message.

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

Until next time!

Subscribe to get these updates mailed to you.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK