This week in Rails
Jun 11 2017
This Week in Rails: default option for mattr_accessor, write_multi and more!
here bringing you the latest news from the Rails world. Let's get started 🚅
🎉 This Week's Rails contributors! 🎉
We had 21 awesome people who helped make Rails better this week. Two of them contributed for the first time ever!
Would you like to help as well? Head over to the 👉
💪 mattr_accessor gets the `default` option 💪
Followup to adding the
option to the
macro, it is now added to
family of methods as well.
It can be used as follows:
mattr_accessor :always_write_cookie, default: false
💪 Write multiple cache entries at once with write_multi 💪
A new method
has been added to the cache stores which writes multiple cache entries at once.
Rails.cache.write_multi foo: 'bar', baz: 'qux'
The default implementation just calls
one by one for each entry but specific cache stores can override this behavior as per their ability of doing bulk writes.
⚡️ Generate field ids in `collection_check_boxes` and `collection_radio_buttons` ⚡️
This change fixes an issue with collection checkboxes and radio boxes where clicking on the labels was not selecting the options because the input elements did not have proper id attribute with respect to their labels.
✨ Fix partial cache logging getting attributed to wrong partials ✨
This commit fixes an issue with the cache hit/miss log markers being applied to wrong partials.
That's it for this week, as always, we couldn't cover all of the changes, but feel free to check all the
from this week.
Until next week! 👋👋
This Week in Rails · 30 N Racine #200 · Chicago IL 60607 · USA