Skip to main content
Gustavo Caso

Gustavo Caso

I’m a software engineer currently working @ Datadog bringing security awareness.

I’m based in Madrid 🇪🇦

I mostly write about ruby and stuff I find interesting. When I’m not at home you will find me 🧗⛰️🍻

Recent

Lazy Enumerator
·121 words·1 min
ruby
Recently reading some posts about ruby, I found myself with this exciting method called lazy. This method will help us when looping over some objects: Array, Hashes, and Files. If you want to loop through a huge array, and we only want to select the first 20 elements that evaluate our criteria, this is the kind of job for our lazy method.
Restore PostgreSQL backup within Heroku
·138 words·1 min
heroku postgresql
Recently I was playing around with my local database in my Rails project deployed using Heroku. Eventually, I screwed up and had to delete all the data. I use rake db: reset and rake db:create`, but how would I populate the data again?
Delayed job, Heroku and sending an email with attachments
·465 words·3 mins
rails ruby heroku delayed_job
Rails make it extremely easy to send emails. I’m not going to explain how to do it; there are pretty good tutorials around the internet, this one is well explained: Action Mailer Basics.
Integrate Disqus with Octopress
·393 words·2 mins
ruby octopress
I’m new to Octopress platform for Blogging, but I think it is excellent and straightforward. Creating my first post, I felt so excited, similar to when you discover a new treasure or secret path in my favourite game.
Rails and select
·210 words·1 min
ruby rails
In a rails project I’m working on, I was trying to select from the database some sales with some conditions. Here is the Sale model: class Sale < ActiveRecord::Base belongs_to :voucher belongs_to :client has_many :line_items, dependent: :destroy has_many :bills end So the goal of the task was to obtain all the Sales where the LineItems has express_checkout set it to true.