Codeminer42's Engineering Blog
Posts

4.5 Ways to Install Ruby in Userspace
Recently a Rubyist friend of mine got a new client. He liked the client’s software idea, but the software was written in Python. Because of that, he thought about rejecting…
A Quest for Better Specs: Prefer Self-Containment
Test suites all over Ruby land are frequently riddled with a bad obsession: one liner spec examples. No matter what level of complexity a particular piece of code may intrinsically…
Prevent a force pushing to master with ruby
Yeah, everyone knows, it’s the mor law of versioned systems, NEVER do a git push -f on the default branch, never, even when you know what you’re doing, bad things…
Controller Best Practices: Don’t Hide Instance Variables
This is something I often mention in code reviews, and it’s also mentioned in some Rails guidelines elsewhere without further explanation: please, don’t hide instance variables. Everyone who has dealt…
Using ActiveRecord to create atomic transactions
Imagine the following situation: You were asked to create a new wallet feature to an application. This wallet must allow money transfer between users. Basically, you take money from an…