This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Document < ActiveRecord::Base | |
after_save :update_permalink | |
def to_param | |
permalink.blank? ? id.to_s : permalink | |
end | |
private | |
def update_permalink |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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} *" |