Friday, April 8, 2016

This week in Rails: strong ETag validators, Action Cable enhancements and more!

Posted by repinel

Hello everyone! This is Roque bringing the latest news from Rails. Hope you enjoy, and see y’all at the RailsConf in a month!

This Week’s Rails Contributors

This week 39 people contributed to Rails. We also got 11 first time contributors. Welcome aboard folks and keep it going!

Strong ETag validators

Strong ETag is now available in addition to weak ETag. It implies that the response should be exactly the same and byte by byte identical. Useful when doing things like Range requests within a large video or PDF file.

Action Cable protocol negotiation

Action Cable will gracefully disconnect clients and disable the monitor if the protocol has changed. This allows clients to gradually move to the newest version.


Allow passing record being validated to error message generator

The record being validated is now accessible from the message proc to generate custom error messages like: proc { |record, data| "#{data[:attribute]} failed with value #{}." }

Add non-US format support to number_to_phone

Need to format a non-US phone number? You can now use number_to_phone with the :pattern option as a Regexp.


Fixed duplicated emails issue with Sendmail

There was an issue with Action Mailer when calling Sendmail with the -t argument. Sendmail would scan messages for recipients, and it could result in duplicated emails.

Fixed the String#to_time behaviour to match Ruby’s

Previously, the method returned today’s midnight time when there was no relevant information in the string. Now it returns nil.

Wrapping Up

That’s all for This week in Rails. As always, there are plenty of things we’re not able to cover here, so take a look at the changes yourself.

Until next time!