Skip to content

Commit

Permalink
TWIR 01-03-2024
Browse files Browse the repository at this point in the history
  • Loading branch information
morgoth committed Mar 1, 2024
1 parent a53d8ea commit 1712a98
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions _posts/2024-03-01-this-week-in-rails.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
layout: post
title: "Added fixture method and bugfixes"
categories: news
author: Wojtek
og_image: assets/images/this-week-in-rails.png
published: true
date: 2024-03-01
---


Hi, [Wojtek](https://twitter.com/morgoth85) from this side. Let's explore this week's few changes in the Rails codebase.

[Expose a generic "fixture" method in tests](https://github.com/rails/rails/pull/51213)
To avoid conflicting methods, in example with Minitest, it is possible now to load fixtures like this:

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

[Introduce assert_initializer](https://github.com/rails/rails/pull/51176)
Compliments the existing *initializer* generator action.

[Set default_url_options values in development/test environments](https://github.com/rails/rails/pull/51191)
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](https://github.com/rails/rails/pull/51165)
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](https://github.com/rails/rails/compare/@%7B2024-02-25%7D...main@%7B2024-03-01%7D)._
_We had [13 contributors](https://contributors.rubyonrails.org/contributors/in-time-window/20240225-20240301) to the Rails codebase this past week!_

Until next time!

_[Subscribe](https://world.hey.com/this.week.in.rails) to get these updates mailed to you._

0 comments on commit 1712a98

Please sign in to comment.