Do you know how helpful the const_get method is?
First, we will understand how the const_get method works then I will explain how we can use it in different ways and what are the use cases.
First, we will understand how the const_get method works then I will explain how we can use it in different ways and what are the use cases.
Ruby is developer friendly language and it provides many ways to perform same task. For example for printing the output on the console we can use puts, prints and p. But multiple ways to do same task means more confusion for selecting correct way for our use case. In this blog we will discuss about difference between puts, print and p so that we can select correct method as per our use case.
Yesterday, I was working on an issue in which database value for particular object attribute was correct but on UI it was showing the wrong value. I dig into the front-end Javascript code and I found that bug occurred while merging the two objects in Javascript. first, we will discuss how to merge two objects then I will explain what we should care about while merging two objects.
Today I attend Ruby Conference at Pune and Singleton method and metaclass in ruby was one of the talk discussed there So, I thought to write a blog about it.
Rails follow the DRY principle of software development and that is 'Don't Repeat Yourself'. Scopes is are great to keep our code DRY and well organized. It's just a set of pre-defined SQL queries that we can use to write complex queries.