|
| 1 | +--- |
| 2 | +layout: post |
| 3 | +title: "Deprecation, bugfixes and more!" |
| 4 | +categories: news |
| 5 | +author: Greg |
| 6 | +og_image: assets/images/this-week-in-rails.png |
| 7 | +published: true |
| 8 | +date: 2024-02-02 |
| 9 | +--- |
| 10 | + |
| 11 | + |
| 12 | +Hi, it's [Greg](https://greg.molnar.io). Let's explore this week's changes in the Rails codebase. |
| 13 | + |
| 14 | +[Deprecate passing _nil_ as model argument](https://github.com/rails/rails/pull/50931) |
| 15 | +Passing `model: nil` as an argument to the `form_with` method will be deprecated in the next release of Rails. |
| 16 | + |
| 17 | +[Skip CSS when creating APIs](https://github.com/rails/rails/pull/50907) |
| 18 | +This pull request makes the Rails generator skip the CSS part if the `--api` flag is set, because CSS is unnecessary for API only apps. |
| 19 | + |
| 20 | +[Commented out lines in _.railsrc_ file should not be treated as arguments](https://github.com/rails/rails/pull/50904) |
| 21 | +Before this change, commented out lines in the .railsrc file were parsed as arguments if the commented part had any arguments inside. This pull request fixes that. |
| 22 | + |
| 23 | +[Add _row_count_ field to _sql.active_record_ notification](https://github.com/rails/rails/pull/50887) |
| 24 | +This pull request adds a `row_count` field to the `sql.active_record` notification, which returns the amount of rows returned by the query that emitted the notification. |
| 25 | +This metric is useful in cases where one wants to detect queries with big result sets. |
| 26 | + |
| 27 | +[Allow encryption without compression](https://github.com/rails/rails/pull/50876) |
| 28 | +This pull request adds an option to `ActiveRecord::Encryption::Encryptor` to disable compression: |
| 29 | +```ruby |
| 30 | +class User |
| 31 | + encrypts :name, encryptor: ActiveRecord::Encryption::Encryptor.new(compress: false) |
| 32 | +end |
| 33 | +``` |
| 34 | +You may want to avoid compression if your data is already compressed, or to prevent revealing information about the entropy of the encrypted value. |
| 35 | + |
| 36 | +_You can view the whole list of changes [here](https://github.com/rails/rails/compare/@%7B2024-01-26%7D...main@%7B2024-02-02%7D)._ |
| 37 | +_We had [25 contributors](https://contributors.rubyonrails.org/contributors/in-time-window/20240126-20240202) to the Rails codebase this past week!_ |
| 38 | + |
| 39 | +Until next time! |
| 40 | + |
| 41 | +_[Subscribe](https://world.hey.com/this.week.in.rails) to get these updates mailed to you._ |
0 commit comments