ruby

Ruby on Rails object lifecycle and callbacks

In ROR, the lifecycle of an object is attached to the database of the application. Objects are created in memory first then later stored in the database. An object have following lifecycle Creation Validation Save Update Deletion These lifecycle have callbacks attached to each of them by which we can inject our custom logic. Creation…

ruby

Send keyword in Ruby

Recently I have been introduced to ruby, while working on the project I saw this function is been used many times in our existing codebase. Let’s discuss what problem it solves. Consider you want to call a list of functions dynamically, eg. Consider an interaction to list animals data which takes the animal name as…

Tech

Configuring Debugger for Jruby in vscode

Recently, I configured a debugger for my jruby application on VScode. I have spent almost 1 day on this and few posts discuss this issue. My jruby version is 9.2.9.0. so I can guarantee the following steps definitely will work for this version. Step 1: Install debug related gems Step 2: Configuring launch.json Create a…