Saturday, February 7, 2015

This week in Rails: locate_many, emoji partials and more!

Posted by huoxito

Hey there!

Newsletter team is back to your inbox delivering all latest good commits and pull requests from Rails. Hopefully you have your favorite drink right there with you to make this quick reading ever better.

This week’s Rails contributors

Over 25 people contributed to Rails this week alone. Perhaps by our next newsletter your name could be on that list too!


Efficient lookup for many models in Global ID

Latest version of Global ID 0.3.2 brings better look up for models. You can pass an array of ids to locate_many to fetch records only once per model. Check out the juicy comments of Core Team members figuring out their own API.

Partial names don’t have to be valid Ruby identifiers

Rails master can render partial names like _the-friday-party.html.erb just fine now as well. If you are feeling extra adventurous, you might even try naming your partials with emojis!

perform_enqueued_jobs can filter jobs by type

By passing a only option you are able to test only those particular jobs while any other inside the block won’t be performed. Checkout the changelog entry introduced for a crystal clear example usage.


Child record validation respects validate: false on parents

Took a few years but this is fixed! Persisting child records will respect the current validation state of the parent record. Also good to see how the team is worrying about performance penalties for fixes in ActiveRecord core logic.


Dropping xhr helper to simplify AC::TestCase

You will need to update your test suites in case they use either xhr or xml_http_request test helpers. Instead switch to the regular get and pass the keyword argument xhr: true

Farewell Rails built in documentation tasks

Now comes a goodbye to a few friends most of us never knew we had: the documentation rake tasks. The three siblings doc:app, doc:rails and little doc:guides joins local documentation in a better place - online. Our thoughts are with the remaining rake tasks. Rest In Protocols.

One More Thing™

Eileen M. Uchitelle is a Rails Committer

Eileen has been doing awesome work on Active Record related to performance refactoring and bug fixes besides mentoring some students in the Facebook Open Academy program.

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!