Sohaib.io

Classes vs Modules for Obese Models

The concept of Thin controllers and fat models is preached heavily to individuals who are just picking up Rails. In my opinion the same concern should be extended to models as well. Quite often is it the case that models in a Rails app tend to get really large(1000

Using GraphQL, a Ruby on Rails Introduction

GraphQL has been stirring up quite a buzz ever since it was introduced by Facebook. Since then companies like Github, Shopify and Pinterest have been using it as a core part of their technology stack. A typical GraphQL query would be structured as below: { allMovies { title description } } GraphQL provides flexibility

Scoping in Ruby

Around a month back, a colleague of mine and I were playing around with nesting and variable scopes in ruby. Here is a small piece of code I wrote for better understanding what is going on. A = 'I am A' module Foo B = 'I am B' puts Module.nesting.inspect

Sohaib.io © 2026