Counting things in Active Record
The count method Ruby implements its own count method, which counts the number of elements in the given array. However, ActiveRecord::Relation class implements its own implementation […]
The count method Ruby implements its own count method, which counts the number of elements in the given array. However, ActiveRecord::Relation class implements its own implementation […]
Ruby on Rails is a mature technology, and probably that’s why many people say that it’s a dead technology. But […]
Even though Ruby owes most of its popularity to the Ruby on Rails framework, many other great frameworks and libraries […]
Without the modules, you would have to rely on inheritance to organize your code and make it more reusable. Such […]
Given we have the following Person class: class Persondef initialize(age:)@age = ageend def [email protected] > 17endendAnd equally simple test in […]
Enum is a shortcut for the enumerated type, a data type consisting of a set of values. Rails provides enums […]
Fixing performance issues Problem: you are parsing a large CSV file, and it takes a lot of time to process […]
RSpec installation RSpec is available as a gem, but it’s a meta-gem, which means that it depends on other gems. […]
You can easily take down your database with not properly designed transaction When you wrap the code inside the transaction […]
The way the includes method work in Active Record is one of the most common questions during interviews, yet many […]