Restore PostgreSQL backup within Heroku
·138 words·1 min
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.
Rails Postgresql Error ORDER clause
·135 words·1 min
While working on a rails project recently, I stepped on an error that said: PG::Error: ERROR: column “number” must appear in the GROUP BY clause or be used in an aggregate function`,
Rails and select
·210 words·1 min
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.
Integrate Disqus with Octopress
·393 words·2 mins
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.
File rename in ruby
·242 words·2 mins
While doing some exercises in the book Learn to Program by Chris Pine, trying to rename some files I noticed a strange functionality as part of some exercise that was renaming pictures from a folder.