Saturday, February 28, 2015

This week in Rails

Posted by gregmolnar

Another week went by and here we are again, this is Greg with the latest news from the Rails community.

This Week’s Contributors

36 amazing people helped to make Rails even better this week! Thanks everyone!

Interview with Carlos Antonio and Rafael França

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.

New Stuff

Default belongs_to validation

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.

Move the validate! method to ActiveModel::Validations

validate! was part of Active Record, but with this commit you can use it on any Active Model object!

Allow limit option for MySQL bigint primary keys

From now on, you can set a limit for your bigint type primary keys in MySQL.


Faster template partial caching

Collections automatically use a read_multi for partials starting with a cache call from now on, which makes them faster.


Fixed ActiveModel.model_name.to_json

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.

Fixed mysql’s schema.rb dumper

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.


skip_action_callback is deprecated

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.

One More Thing™

Richard Schneeman is a Rails Committer!

Please welcome our newest Rails Committer @schneems!

Wrapping up

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!