One more article about ruby best practice
Vladislav Kopylov
541

dont this:
if some_hash.present?
var = some_hash.fetch(:key_1, {}).fetch(:key_2, nil)
end
instead use dig:
if some_hash.present?
var = some_hash.dig(:key_1, :key_2)
end

way more readable :)

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.