Skip to content

Instantly share code, notes, and snippets.

class Document < ActiveRecord::Base
after_save :update_permalink
def to_param
permalink.blank? ? id.to_s : permalink
end
private
def update_permalink
@jamesu
jamesu / deploy
Created February 25, 2009 15:13 — forked from peterc/deploy
#!/bin/bash
REMOTE_HOST='whatever'
USERNAME='whatever'
git push origin master && ssh ${REMOTE_HOST} "cd /home/${USERNAME}/www/rails;git pull origin master;chown -R ${USERNAME}:${USERNAME} *"