This week in Rails
Beware of those,
In forests reigned by cawing crows
Who feel the fright, a stormy friday night
Your weekly Rails news, pick and choose
As we weave, this;
All Hallow's Eve
Bet you didn't expect to get spooked the day before Halloween, well, that's our trick-a-trété. What? That's what the french say — don't ask.
This week 42 contributors gathered in the town square, pitchforks in hand, and chased bugs out of Rails and up the mill.
That's what mob programming is all about. I assume.
Say, a USA and a USSR model employed defensive measures to destroy the other if they we're destroyed. Before they'd keep destroying the other, now they're more peaceful only destroying each other once. Good thing it's a fictional example 😁
Have models with accepts_nested_attributes_for? The macro nestled out an index_errors option, so errors attach to a specific model in the submitted array.
There's comments on the pull request, if you want to improve it further.
There's now an explicit way to do this specific join — abstracted away in includes before.
For those who want to be left out, er... join in!
While calling count on a has_and_belongs_to_many relationship was correctly counted, amping up the inclusion made threw off the count. Now you can use includes and have things counted correctly again.
You'd have to remember to sanitize arguments you passed to order, which, if you have an example like the one in the pull request, is a pain. No more.
Passing an object that responds to to_hash to HashWithIndifferentAccess.new now respects the default values and default proc if any of those are there.
Last week, we incorrectly said this change would raise exceptions. What really happens is delegate now works with block, args or arg if those light your Jack-o'-lantern.
That's all for This week in Rails. As always, there are many more changes than we have room to cover here, but feel free to check them out yourself.
Until next time!
Also if you really want to be scared, look yourself in the mirror! Boom, nailed it!