Hey there, detective! Here’s Kasper fumbling through his own trenchcoat for his notebook to give you what went down on the Rails codebase this week.
If you’ve been looking to expire a key, either when incrementing or decrementing it, with Rails 5.2s Redis cache store. Just pass _expires_in _to make the key sleep with the fishes.
The Rails guides are vast and deep. There’s so many that the digging deeper section almost dug its own grave. But splitting out into another section is a saving grace. Why not look through the current guides?
For many years has_secure_password only allowed a default password attribute. But now you can stash whatever you want in there.
Instantiating a list of Active Record objects is now faster and allocates less. If the array has the same instances that is. It’s made possible by not looking up the same STI column each time through the loop.
In lighter documentation news the old Mac OS X spelling has been replaced by macOS where applicable.
Rails 5.1s syntactic sugar for retry_job, retry_on and discard_on that is, only took one exception so you’d have to duplicate exception blocks or spread a retry on multiple lines. No longer! Get your high in a single line of sugar.
20 people contributed to Rails this past week. There might be some open issues you can try tackling?
See you next week!