by Kevin Murphy
We love reading, watching, and listening to constantly update our skills and learn new perspectives. Here are some of the exciting pieces we learned from this month.
This is a great refresher on the "classic" testing pyramid, but also taught me about many other models. Have you heard of the testing trophy? Or the delicious sounding ice cream and cupcake anti-patterns? This article introduced me to those concepts.
The section on converters draws attention to an incredibly-useful and previously unknown to me feature of Ruby's CSV standard library.
There are tips galore for both authors and reviewers of code to be found in this article.
Navigating the waters of an organization can be difficult - there's rarely a map. While I don't have a compelling conclusion to this metaphor that says, "something something - build a bridge instead", I do highly recommend reading this post, and the many links it provides, to gain valuable insights on working with others in any company.
Resolving merge conflicts can be tricky, especially when they occur in the lock file where intent is not always clear and the file could be thousands of lines long. This article provides a few simple steps to sanely and quickly resolve lock file conflicts.
I grimaced when I saw that the designs had a custom style for an ordered list. I brainstormed ways I could do this in a clean and extensible way. Turns out it's much easier than I thought ;).
Because ActiveRecord doesn't support PostgreSQL's
time column type out of the box, handling time-of-day logic in Rails isn't as straightforward as I would have expected. This article however provides some interesting - and fortunately very eloquent - solutions using a particlar gem.
Honestly, this doesn't come up that often. But I found it to be a neat little trick that can help you keep track of how things move around when you're trying to remember how things work (and don't need to be distracted by the specifics of managing code in your editor). Plus there's a good quick explanation of
noremap in the comments!
Earlier this month, I was tasked with prohibiting certain types of users from making changes to a subset of attributes on a model. The Pundit gem that we are using for authorization makes this much easier than I have anticipated by allowing a
permitted_attributes method to be defined on the policy that returns the list of allowable attributes. The attributes can then be retrieved from the policy from within a controller.