Skip to content

Instantly share code, notes, and snippets.

View bowmande's full-sized avatar

Drew Bowman bowmande

View GitHub Profile
@shripadk
shripadk / gist:552554
Created August 27, 2010 00:59
Setting up Heroku Hostname SSL with GoDaddy SSL Cert
How to setup Heroku Hostname SSL with GoDaddy SSL Certificate and Zerigo DNS
Heroku recently added an exciting new 'Hostname SSL' option. This option offers the broad compatibility of IP-based SSL, but at 1/5 the price ($20 / month at the time of this writing).
The following tutorial explains how to use Heroku's new 'Hostname SSL' option on your Heroku project. Before we begin, let's list what we're using here:
* Heroku Hostname SSL
* GoDaddy Standard SSL Certificate
* Zerigo DNS
@ddonahue99
ddonahue99 / gist:3098825
Created July 12, 2012 15:20
rake db:remove_orphans - detects orphans based on belongs_to relations and prompts to remove
namespace :db do
desc "Remove orphans"
task :remove_orphans => :environment do
Dir[Rails.root + "app/models/**/*.rb"].each do |path|
require path
end
ActiveRecord::Base.send(:descendants).each do |model|
model.reflections.each do |association_name, reflection|
if reflection.macro == :belongs_to
delete_all_like_this = false