How Ruby 2.6 allowed me to do another open source contribution

Every minor Ruby release brings some new features to the language. Few interesting articles describing Ruby 2.6.0 changelog have already been published, so describing them is not the goal of this article. However, one of them allowed me to do another open source contribution, and in my opinion, that is something worth sharing. Maybe it will inspire you to do the same.

Read more...
 

Why don’t we validate controller parameters?

Using strong parameters in Ruby on Rails applications to allow permitted values is usually not enough. Taking care of validating allowed values to make our applications is also important to make them more secure and less error-prone. To handle the validation properly we can write custom solution(s) or use handy gems like apipie-rails.

Read more...
 

Not-so-private constants in Ruby

Using constants is idiomatic for Ruby. We use them to store something meaningful (a well-suited name is very important), connected with a class that holds it. Consequently, we make our code easier to reason about, avoid duplication and, very often, more performant.

Read more...
 

Is `Array` the only option for storing elements in Ruby?

Array class is one of the most commonly used Ruby class in day-to-day development. Enumerable module adds a comprehensive set of methods which makes playing with arrays a pleasant activity. I have just written set deliberately.

Read more...
 

Common mistakes that cause Ruby on Rails apps outages

Everybody makes mistakes. Some of them are caught early in a deployment pipeline: during writing code, testing it locally or code review process. Unfortunately, some hide cleverly and pop up on the production environment.

Read more...
 

Ruby `allocate` method

TIL that Ruby, or to be more precise Class class, offers allocate public instance method.

Read more...
 

`ActiveSupport::ArrayInquirer` and even more Rails magic

In the previous article, we dived into ActiveSupport::StringInquirer class and superpowers it gives to String objects.  After I had published that article I decided to take another look at the ActiveSupport module and to my surprise, I found something even more interesting, ActiveSupport::ArrayInquirer class.

Read more...
 

`ActiveSupport::StringInquirer` magic

Rails magic is a widespread term among developers working with Ruby on Rails application. Is it an overstatement? Well, it depends. 

Read more...
 

How to log HTTParty requests

Today I learned that HTTParty gem has a built-in option for enabling logging details of all requests made by the gem.

Read more...
 

5 security issues in Ruby on Rails apps from real life

…and how to fix them 🙂

Read more...