How to use a Singleton method in the rails.
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.
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 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.
In the internet era, every organization is storing large data and it is difficult to maintain this much data. There are different databases available but it is very difficult to select the best suitable for our requirement. Mainly databases are classified into Relational database and Non-relational database.
Sometimes, the implementation of an algorithm can make performance worst. Then it does not matter whether it has used the faster programming language like C or slower like Ruby. So we should implement the algorithms properly. Same while dealing with the database we should use proper queries so that the performance should not affect.
This is my first post, how exciting!!