Friday, April 3, 2015

This week in Rails

Posted by gregmolnar

Happy Good Friday Everyone!

Here comes the gist of last week’s interesting commits from Rails. Stay tuned!

This week’s Rails contributors

We had 30 amazing contributors this week, big thanks to all them!

New Stuff

Explicit base class for Active Job jobs

It is recommended to not change settings on ActiveJob::Base directly so from now on every generated Job will inherit from ApplicationJob and you can tweak that for your needs.

Rails uses Sprockets 3 now!

Sprockets 3 will be released soon and the Rails team decided to give the release candidate a try.

Deprecated

Deprecate the :tokenizer option in validates_length_of

This option only served an extremely specific use case hence became deprecated. If you rely on this functionality, you can implement it with a plain Ruby method.

Improved

Only coerce time in comparison if necessary

In the development environment ActiveSupport::FileUpdateChecker#max_mtim triggers many time comparison and there were many unnecessary to_time calls. With this patch Rails saves around 100ms per request!

Reduce memory usage when loading types in Postgres

The PG::Result object were never cleared when the application queries the types. By clearing that object Rails use less memory.

Fixed

Return super in ActionController::Parameters.const_missing

With this pull request ActionController::Parameters.const_missing’s super is always returned whereas before it was only called and its return value was mistakenly discarded.

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!