Good news everyone, we made it to Friday, and it's time for another issue of This week in Rails. \o/
For those of you who are using Gmail, last week's issue might have looked a bit weird. Apparently I packed way too much awesome goodness into a single email last week and Gmail decided to truncate it. If you haven't had a chance to read the full issue, you can head over to the archives to catch it.
With that out of the way, it's time for this week's interesting commits and pull requests from Rails!
On July 25, 2004, DHH released the first public version of Rails to the world. On this coming Thursday, we will finally see the first batch of applicants for jobs that require 10 years of Rails experience.
Since DHH made the first public release of Rails 10 years ago, over 3500 individuals (the real number is likely to be a lot higher) have contributed to the Rails source code and documentation.
Known for his amazing work on Active Record and spring, Jon Leighton is now officially a core team alumni. You can thank him for his work and follow his latest adventures on twitter.
To be clear, this is about running (a small subset of) Rails' own test cases in parallel, and it does not affect how your app's test cases are executed, but still pretty cool nonetheless. (If you are using minitest, and you know that your app is thread-safe, you can also try this at home and see how it goes!)
These methods were previously added in #12016, but they have found a new home with this commit in the Digest module. Unlike version 4, which uses a random source, these two versions of UUID are based on the MD5 and SHA1 hash functions and is suitable for cases where you would like to generate the same "stable" UUIDs when given the same input.
This probably happened to the best of us at some point when working on Rails projects – using validate when you meant to use validates. This would hopefully help you catch these mistakes earlier and easier.
Last week we covered the new APIs in ActiveModel::Dirty for restoring in-memory changes. To prevent confusion around some similarly named methods, the related APIs have been renamed to restore_attributes and restore_* (e.g. restore_name). See also this related commit.
Hash#transform_values was another addition we covered last week. With this pull request, it has learned to return an Enumerator object when used without a block to be more like its cousins in Ruby's Enumerable module. (There's also some interesting tidbits in there about how Ruby work with the &block argument internally.)
On top of minitest's built-in assertion helpers, Rails defined certain extra convenience helpers such as assert_not_* and assert_predicate. These tend to read nicer in most contexts and sometimes provide better error messages.
When working with non-ASCII charsets, String#size might be different from String#bytesize. While you would usually want #size, #bytesize might come in handy when working at a lower level (such as this case).
Wrapping up
And that's it for this issue of This week in Rails. As always, there are way too many changes on Rails to cover in this newsletter, so I encourage you to check them out!
If you have any feedback for me, please feel free to email me or let me know on twitter! Thank you for reading! <3 <3 <3