Skip to content

CODETUNES

This is CODETUNES, a blog by MONTERAIL, an offshore Ruby on Rails development agency.

Articles

Review your code with GitHub Code Review

Your code sucks.

It might be hard to believe, so please stop reading for just a minute and go find some of your old code. No, seriously. Do it. I’ll wait.

You’re back? Good. Now tell me, what do you think about that code? I know. It’s bad. Right now you’d certainly write it in a completely different and better way. And I believe you. The problem...

Fixing legacy code

There’s a red alert in your mailbox and you know exactly what it means - the system is down and you have a 500 error on a specific action. Your response is clear - you find the bug and fix it as fast as you can.

Problem

In most cases, tweaking code - particularly someone else’s work - involves adapting to the multitude of styles and errors that...

How to make Rails, Grape and Her work together (with caching!)

If you follow our series on building APIs with Grape and Rails, you already know how to create powerful versioned APIs in a simple and straightforward way as well as improve Grape’s abilities with a number of useful tricks.

Building an interface, however, is often just the first step. The real challenge begins when your application needs to rely...

How to turn teamwork into culture

Teamwork is hard.

Here’s the situation: the requirements have once again changed. The deadline is approaching. The current sprint ends tomorrow and some user stories are still not yet finished. If you’re a startup, you know exactly how this feels.

So your focus shifts towards delivering features and ignoring non-critical issues—things like updating...

FactoryGirl many-to-many setup

Recently, we were looking at how to set up a many-to-many relationship with FactoryGirl. Unfortunately, Google wasn’t all that helpful in solving this problem, so we had to figure out this issue on our own. We found that the only possible solution is to use the after_create callback as the example below shows:

FactoryGirl.define do
  factory :book