Another week went by and here we are again, this is Greg with the latest news from the Rails community.
36 amazing people helped to make Rails even better this week! Thanks everyone!
Interview with Rails Core team members about early days of their Rails contribution, Rails team, Brazil Rails community, their day to day tools of choice and workflow, and how everyone can help out with Rails.
belongs_to
relations will now trigger a validation error by default if the association is not present.
If you wish, you can turn this off with the optional: true
option per association.
validate!
was part of Active Record, but with this commit you can use it on any Active Model object!
From now on, you can set a limit
for your bigint
type primary keys in MySQL.
Collections automatically use a read_multi
for partials starting with a cache call from now on, which makes them faster.
Previously, calling User.model_name.to_json
would result in an infinite recursion, because .model_name
inherited .as_json
from Object.
This commit delegates as_json
to the correct handler to fix that.
MySQL doesn’t have a boolean
datatype, it uses a tinyint
with a limit
option, so if we dumped the schema from MySQL we couldn’t load it to Postgres since limit
is invalid for Postgres booleans. This patch fixes that by not adding the limit
to schema.rb
.
In future skip_before_action
, skip_after_action
and skip_around_action
will raise an ArgumentError
if the callback doesn’t exist, so using skip_action_callback
, which calls all three methods will probably fail, therefore it became deprecated.
Please welcome our newest Rails Committer @schneems!
That’s all for This week in Rails. As always, there are more changes than we have room to cover here, but feel free to check them out yourself!
P.S. If you enjoyed this newsletter, why not share it with your friends? :) If you wish to be part of this project please don’t hesitate to contact Godfrey – there’re a lot of ways you could help make this newsletter more awesome!