Learn about hash value omission in Ruby, their benefits, examples, and implementation guidelines for more concise code
Learn about hash value omission in Ruby, their benefits, examples, and implementation guidelines for more concise code
Use ActiveRecord::Suppressor, conditional callbacks, or patch ApplicationRecord to skip Rails callbacks.
1975 paper: analyzing system program bugs, stressing problem definition, domain knowledge, diverse error categories for software quality
Explore Ruby's pass-by-value approach, enabling object modification without altering original references, which is essential for efficient object handling
Look at your code and identify any areas where you can improve. Refactoring isn't about fixing bugs but improving your code's readability, efficiency, and maintainability. Look ...
What is method gravity? What I call Method Gravity means for me: The bigger the method the more new lines of code will be added to it. I noticed this while working on various ...
I like to use as much as possible the new features in Ruby. In this case, I will show how to take advantage of shorthand hash syntax whileThe on changing from instance variables...
Code Design Inertia: The code that will be written in the future will follow the design of the code already written. Inertia is stronger inside a file => the code added will f...
If you want to freeze strings in Ruby there are at least two ways to do this: 1) Adding the magic comment at the beginning of the file # frozen_string_literal: true 2) Calling ...
I think learning Ruby has three parts: OOP + SOLID in Ruby Ruby Syntax Idiomatic Ruby What follows assumes you already know how to program in any other programming language...
Context Let's say I am working on a project named "short-ruby" 😉 That project is currently located somewhere like /home/lucian/projects/short-ruby Let's say that I am currentl...
If you just started to learn a programming language and web framework, here is my suggestion about what to work on: What project to work on Choose a successful SaaS product tha...
How do these things work? Have you ever wondered how the following code works? Specifically, how come the key will have another value than true or false. key = loaded_key || Ke...
Context Let's say that you have two array of hashes: a = [ { initial: "a", email: "a@example.com" }, { email: "b@example.com", initial: "b" }, { ...
This is more like general advice, but when possible minimize dependencies. I will write the following examples with Ruby gems in mind but could be used in any other programming...
Context You have an array of hashes and want to check if all elements are satisfying a condition. TIL You might want to do this in Ruby: objects.all? { _1[:amount] > 10 } In th...