Skip to content

Commit

Permalink
Fix codeblock and author name
Browse files Browse the repository at this point in the history
  • Loading branch information
siaw23 committed Feb 24, 2024
1 parent eb75d81 commit 9dcd262
Show file tree
Hide file tree
Showing 18 changed files with 185 additions and 181 deletions.
2 changes: 1 addition & 1 deletion _import-this-week-in-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def extract_author_url
def extract_author_handle
case url = extract_author_url
when /hayford/
'siaw23'
'Emmanuel Hayford'
else
url.split('/').last
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,42 @@
layout: post
title: "Rails security releases, Improved generator option handling and more..."
categories: news
author: siaw23
author: Emmanuel Hayford
published: true
date: 2022-07-15
---

Hi! [Emmanuel](https://twitter.com/siaw23) here with updates from Rails over the last week.
[Rails Versions 7.0.3.1, 6.1.6.1, 6.0.5.1, and 5.2.8.1 have been released!](https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017)
A few days ago Rails released versions 7.0.3.1, 6.1.6.1, 6.0.5.1, and 5.2.8.1. These are security updates that impact applications that use serialised attributes on Active Record models. These updates, identified by CVE-2022-32224 cover a possible escalation to RCE when using YAML serialised columns in Active Record.
[Allow opting out of the SameSite cookie](https://github.com/rails/rails/pull/45501)
You can now opt out of using _SameSite_ on your cookies by passing _same\_site: nil_.
[Improve generator implied option handling](https://github.com/rails/rails/pull/45520)
_AppGenerator_ and _PluginGenerator_ implied options have gotten some improvements: Implied options will now be reported in your shell. Conflicting options will raise an error. Meta options and _--no-\*_ options are reported with more precision.
[Add Formatting Full Messages with I18n section in ActiveRecordValidations guides](https://github.com/rails/rails/pull/45470)
Rails Guides received some love. There's now a section on the Active Record Validations guides to demonstrate how full validation messages can be formatted with the help of I18n.
[Add --parent option to job generator to specify parent class of job](https://github.com/rails/rails/pull/45528)
There's now a superclass option in the job generator. It's possible to do _bin/rails g job process\_payment --parent=payment\_job_ to get _class ProcessPaymentJob \< PaymentJob; end_.
[Add include\_seconds option to datetime\_local\_field](https://github.com/rails/rails/pull/45188)
According to [input elements of type time](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time#time_value_format) browsers render time differently if you format time without the seconds bit. This PR adds an option to omit the seconds part of formatted time with _include\_seconds: false_.
[Add timestamptz as a time zone aware type for PostgreSQL](https://github.com/rails/rails/pull/44601)
Previously, support for the _timestamptz_ type on the Postgres adapter was added, this caused issues in some cases where the newly-added _timestamptz_ was not considered timezone-aware attribute. This PR fixes the issue for Postgres users.
[Common Table Expression support added "out-of-the-box](https://github.com/rails/rails/pull/37944)
You can now build sophisticated queries with Common Table Expressions using the _.with_ query method on models. The _.with_ allows the usage of Active Record relations without the need to manually build _Arel::Nodes::As_ nodes.
[Add ActiveRecord::Base::generates\_token\_for](https://github.com/rails/rails/pull/44189)
With this PR, _signed\_id_ is relieved of token generation. Token generation is now directly associated with a record allowing record state to be tracked easily.
[Add quarter to date/time](https://github.com/rails/rails/pull/45009)
_DateAndTime::Calculations_ gets a new method, _quarter_, that returns the quarter of the receiver's calendar year. Here are some examples: _Date.new(2010, 12, 25).quarter # =\> 4_ and _Date.new(2010, 4, 12).quarter&nbsp; # =\> 2_.
Hi! [Emmanuel](https://twitter.com/siaw23) here with updates from Rails over the last week.

[Rails Versions 7.0.3.1, 6.1.6.1, 6.0.5.1, and 5.2.8.1 have been released!](https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017)
A few days ago Rails released versions 7.0.3.1, 6.1.6.1, 6.0.5.1, and 5.2.8.1. These are security updates that impact applications that use serialised attributes on Active Record models. These updates, identified by CVE-2022-32224 cover a possible escalation to RCE when using YAML serialised columns in Active Record.

[Allow opting out of the SameSite cookie](https://github.com/rails/rails/pull/45501)
You can now opt out of using _SameSite_ on your cookies by passing _same\_site: nil_.

[Improve generator implied option handling](https://github.com/rails/rails/pull/45520)
_AppGenerator_ and _PluginGenerator_ implied options have gotten some improvements: Implied options will now be reported in your shell. Conflicting options will raise an error. Meta options and _--no-\*_ options are reported with more precision.

[Add Formatting Full Messages with I18n section in ActiveRecordValidations guides](https://github.com/rails/rails/pull/45470)
Rails Guides received some love. There's now a section on the Active Record Validations guides to demonstrate how full validation messages can be formatted with the help of I18n.

[Add --parent option to job generator to specify parent class of job](https://github.com/rails/rails/pull/45528)
There's now a superclass option in the job generator. It's possible to do _bin/rails g job process\_payment --parent=payment\_job_ to get _class ProcessPaymentJob \< PaymentJob; end_.

[Add include\_seconds option to datetime\_local\_field](https://github.com/rails/rails/pull/45188)
According to [input elements of type time](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time#time_value_format) browsers render time differently if you format time without the seconds bit. This PR adds an option to omit the seconds part of formatted time with _include\_seconds: false_.

[Add timestamptz as a time zone aware type for PostgreSQL](https://github.com/rails/rails/pull/44601)
Previously, support for the _timestamptz_ type on the Postgres adapter was added, this caused issues in some cases where the newly-added _timestamptz_ was not considered timezone-aware attribute. This PR fixes the issue for Postgres users.

[Common Table Expression support added "out-of-the-box](https://github.com/rails/rails/pull/37944)
You can now build sophisticated queries with Common Table Expressions using the _.with_ query method on models. The _.with_ allows the usage of Active Record relations without the need to manually build _Arel::Nodes::As_ nodes.

[Add ActiveRecord::Base::generates\_token\_for](https://github.com/rails/rails/pull/44189)
With this PR, _signed\_id_ is relieved of token generation. Token generation is now directly associated with a record allowing record state to be tracked easily.

[Add quarter to date/time](https://github.com/rails/rails/pull/45009)
_DateAndTime::Calculations_ gets a new method, _quarter_, that returns the quarter of the receiver's calendar year. Here are some examples: _Date.new(2010, 12, 25).quarter # =\> 4_ and _Date.new(2010, 4, 12).quarter&nbsp; # =\> 2_.

[32 people contributed to Rails](https://contributors.rubyonrails.org/contributors/in-time-window/20220704-20220715) since the last time. Until next time!

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: "Cache invalidation via ActiveStorage::Blob, Conditionally executing has_secure_password, etc"
categories: news
author: siaw23
author: Emmanuel Hayford
published: true
date: 2022-07-29
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: "Logging, raising and rescuing errors and a fix for a query method."
categories: news
author: siaw23
author: Emmanuel Hayford
published: true
date: 2022-08-19
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: "Rack 3 and Rails 7.0.4, 6.1.7, and 6.0.6 releases, ActionDispatch::Cookies, etc"
categories: news
author: siaw23
author: Emmanuel Hayford
published: true
date: 2022-09-10
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: "ERB in YAML keys, performance boosts, a new option for QueryLogs!"
categories: news
author: siaw23
author: Emmanuel Hayford
published: true
date: 2022-09-30
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: "An Active Record improvement, performance gains and a bugfix!"
categories: news
author: siaw23
author: Emmanuel Hayford
published: true
date: 2022-10-21
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@
layout: post
title: "The Rails Foundation, Stimulus Outlets API, bug fixes and lots of improvements!"
categories: news
author: siaw23
author: Emmanuel Hayford
published: true
date: 2022-11-19
---

Boa noite! This is [Emmanuel](https://twitter.com/siaw23), bearer of good tidings.
[Introducing: The Rails Foundation](https://rubyonrails.org/2022/11/14/the-rails-foundation)
In case you missed it, with eight founding members, Rails has started The Rails Foundation! Together, the founding members have contributed a total sum of $1,000,000 that will aid the foundation's mission to improve the documentation, education, marketing, and events in our ecosystem. More [here](https://rubyonrails.org/2022/11/14/the-rails-foundation).
[Raise on assignment to readonly attributes
](https://github.com/rails/rails/pull/46105)Attributes that are marked as _attr\_readonly_ would previously fail silently, meaning data won't be written to the database when you tried to assign new values—with this PR, read-only attributes will raise an _ActiveRecord::ReadonlyAttributeError_ when an attempt is made to write to that read-only attribute.
[Allow unscoping of preload and eager\_load associations](https://github.com/rails/rails/pull/45147)
This PR adds the ability to unscope _preloaded_ and _eager loaded_ associations, adding to the list of valid "unscoping" values like _where_, _select_ among others.
[Add filtering of encrypted attributes in #inspect
](https://github.com/rails/rails/pull/46453)Previously, encrypted attributes could be added to an application's _filter\_parameters_ which would filter the attribute values from logs. This commit adds an additional config to enable adding encrypted attributes to records' _filter\_attributes_, which allows them to be filtered when models are inspected (such as in the console).
[Initialize encrypted attributes when using #first\_or\_create or #first\_or\_initialize](https://github.com/rails/rails/pull/46493)
This fixes a bug where one would expect that encrypted values are initialized with the values provided but instead, the encrypted values were _nil_.
[Stimulus gets an Outlets API](https://github.com/hotwired/stimulus/pull/576)
Around Hotwire, this PR received a warm welcome. I reached out to the author, [Marco Roth](https://twitter.com/marcoroth_),&nbsp; who whipped out a documentation that perfectly summarises the Outlet API:
The Outlets API lets you reference Stimulus Controller instances and their _controller element_ from within another Stimulus Controller by using CSS selectors. The use of Outlets helps with cross-controller communication and coordination as an alternative to dispatching custom events on controller elements.
Ruby on Rails saw [22 generous contributors](https://contributors.rubyonrails.org/contributors/in-time-window/20221111-20221118) in the last 7 days.
Talk to you next week.

<p><i><a href="https://world.hey.com/this.week.in.rails">Subscribe</a> to get these updates mailed to you.</i></p>
Boa noite! This is [Emmanuel](https://twitter.com/siaw23), bearer of good tidings.

[Introducing: The Rails Foundation](https://rubyonrails.org/2022/11/14/the-rails-foundation)
In case you missed it, with eight founding members, Rails has started The Rails Foundation! Together, the founding members have contributed a total sum of $1,000,000 that will aid the foundation's mission to improve the documentation, education, marketing, and events in our ecosystem. More [here](https://rubyonrails.org/2022/11/14/the-rails-foundation).

[Raise on assignment to readonly attributes
](https://github.com/rails/rails/pull/46105)Attributes that are marked as _attr\_readonly_ would previously fail silently, meaning data won't be written to the database when you tried to assign new values—with this PR, read-only attributes will raise an _ActiveRecord::ReadonlyAttributeError_ when an attempt is made to write to that read-only attribute.

[Allow unscoping of preload and eager\_load associations](https://github.com/rails/rails/pull/45147)
This PR adds the ability to unscope _preloaded_ and _eager loaded_ associations, adding to the list of valid "unscoping" values like _where_, _select_ among others.

[Add filtering of encrypted attributes in #inspect
](https://github.com/rails/rails/pull/46453)Previously, encrypted attributes could be added to an application's _filter\_parameters_ which would filter the attribute values from logs. This commit adds an additional config to enable adding encrypted attributes to records' _filter\_attributes_, which allows them to be filtered when models are inspected (such as in the console).

[Initialize encrypted attributes when using #first\_or\_create or #first\_or\_initialize](https://github.com/rails/rails/pull/46493)
This fixes a bug where one would expect that encrypted values are initialized with the values provided but instead, the encrypted values were _nil_.

[Stimulus gets an Outlets API](https://github.com/hotwired/stimulus/pull/576)
Around Hotwire, this PR received a warm welcome. I reached out to the author, [Marco Roth](https://twitter.com/marcoroth_),&nbsp; who whipped out a documentation that perfectly summarises the Outlet API:

The Outlets API lets you reference Stimulus Controller instances and their _controller element_ from within another Stimulus Controller by using CSS selectors. The use of Outlets helps with cross-controller communication and coordination as an alternative to dispatching custom events on controller elements.

Ruby on Rails saw [22 generous contributors](https://contributors.rubyonrails.org/contributors/in-time-window/20221111-20221118) in the last 7 days.

Talk to you next week.


<p><i><a href="https://world.hey.com/this.week.in.rails">Subscribe</a> to get these updates mailed to you.</i></p>
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,46 @@
layout: post
title: "Documentation on preloading STIs, TimeHelpers improvement, etc"
categories: news
author: siaw23
author: Emmanuel Hayford
published: true
date: 2022-12-16
---

नमस्ते, This is [Emmanuel Hayford](https://twitter.com/siaw23) with some updates from Rails!
[Hide changes to before\_committed! behaviour behind config](https://github.com/rails/rails/pull/46739)
This PR introduces a new configuration option that will enable _before\_committed!_ callbacks on all enrolled records in a transaction by default in Rails 7.1. Previously, callbacks were only run on the first copy of a record if there were multiple copies of the same record enrolled in a transaction.
[TimeHelpers: include with\_usec keyword parameter on travel & freeze too](https://github.com/rails/rails/pull/46663)
_ActiveSupport::Testing::TimeHelpers_ now accepts a named _with\_usec_ argument to _freeze\_time_, _travel_, and _travel\_to_ methods. Passing true prevents truncating the destination time with _change(usec: 0)_.
[Allow f.select to be called with a single hash containing options and HTML options](https://github.com/rails/rails/pull/46629)
_select_ can now be called with a single hash containing options and some HTML options.
Previously, this would not work as expected:
_\<%= select :post, :author, authors, required: true %\>_
Instead, you needed to do this:
_\<%= select :post, :author, authors, {}, required: true %\>_
&nbsp;Now, either form is accepted, for the following HTML attributes: _required_, _multiple_, _size_.
[Fix inconsistent behavior in form helper date/time tags with options](https://github.com/rails/rails/pull/46678)
DateTime form helpers (_time\_field_, _date\_field_, _datetime\_field_, _week\_field_, _month\_field_) now accept an instance of _Time_, _Date_ and _DateTime_ as _:value_ option.
Previously we had:
_\<%= form.datetime\_field :written\_at, value: Time.current.strftime("%Y-%m-%dT%T") %\>_
And now:
_\<%= form.datetime\_field :written\_at, value: Time.current %\>_
[Document four ways to preload STIs](https://github.com/rails/rails/commit/01bc3a4971068917e755bc0e15e6852cd65edfa9)
This PR documents a couple of ways to preload STIs. The document is on [Edge Rails Guides](https://edgeguides.rubyonrails.org/autoloading_and_reloading_constants.html) and you can read all about it.
Thanks to the [26 contributors](https://contributors.rubyonrails.org/contributors/in-time-window/20221209-202201216) we had in the last week!
Talk to you next week.

<p><i><a href="https://world.hey.com/this.week.in.rails">Subscribe</a> to get these updates mailed to you.</i></p>
नमस्ते, This is [Emmanuel Hayford](https://twitter.com/siaw23) with some updates from Rails!

[Hide changes to before\_committed! behaviour behind config](https://github.com/rails/rails/pull/46739)
This PR introduces a new configuration option that will enable _before\_committed!_ callbacks on all enrolled records in a transaction by default in Rails 7.1. Previously, callbacks were only run on the first copy of a record if there were multiple copies of the same record enrolled in a transaction.

[TimeHelpers: include with\_usec keyword parameter on travel & freeze too](https://github.com/rails/rails/pull/46663)
_ActiveSupport::Testing::TimeHelpers_ now accepts a named _with\_usec_ argument to _freeze\_time_, _travel_, and _travel\_to_ methods. Passing true prevents truncating the destination time with _change(usec: 0)_.

[Allow f.select to be called with a single hash containing options and HTML options](https://github.com/rails/rails/pull/46629)
_select_ can now be called with a single hash containing options and some HTML options.
Previously, this would not work as expected:

_\<%= select :post, :author, authors, required: true %\>_

Instead, you needed to do this:

_\<%= select :post, :author, authors, {}, required: true %\>_

&nbsp;Now, either form is accepted, for the following HTML attributes: _required_, _multiple_, _size_.

[Fix inconsistent behavior in form helper date/time tags with options](https://github.com/rails/rails/pull/46678)
DateTime form helpers (_time\_field_, _date\_field_, _datetime\_field_, _week\_field_, _month\_field_) now accept an instance of _Time_, _Date_ and _DateTime_ as _:value_ option.

Previously we had:
_\<%= form.datetime\_field :written\_at, value: Time.current.strftime("%Y-%m-%dT%T") %\>_

And now:
_\<%= form.datetime\_field :written\_at, value: Time.current %\>_

[Document four ways to preload STIs](https://github.com/rails/rails/commit/01bc3a4971068917e755bc0e15e6852cd65edfa9)
This PR documents a couple of ways to preload STIs. The document is on [Edge Rails Guides](https://edgeguides.rubyonrails.org/autoloading_and_reloading_constants.html) and you can read all about it.

Thanks to the [26 contributors](https://contributors.rubyonrails.org/contributors/in-time-window/20221209-202201216) we had in the last week!

Talk to you next week.


<p><i><a href="https://world.hey.com/this.week.in.rails">Subscribe</a> to get these updates mailed to you.</i></p>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: "An endpoint for uptime monitors, an improved help command, etc"
categories: news
author: siaw23
author: Emmanuel Hayford
published: true
date: 2023-01-13
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: "Parameter filtering and an improved ActionView::Helpers::TagHelper#token_list"
categories: news
author: siaw23
author: Emmanuel Hayford
published: true
date: 2023-02-10
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
layout: post
title: "TestFixtures#fixture_path deprecation, FinderMethods#find support for composite primary key values, etc."
categories: news
author: siaw23
author: Emmanuel Hayford
published: true
date: 2023-03-18
---
Expand Down
Loading

0 comments on commit 9dcd262

Please sign in to comment.