This file contains 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
1. edit your database.yml, like so: | |
test: | |
adapter: postgresql | |
database: test4 | |
host: dev.berkleemusic.com (or 'localhost', if you're in the VM) | |
username: rails | |
2. RAILS_ENV=test bundle exec rake db:setup |
This file contains 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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
[ -z "$PS1" ] && return | |
# don't put duplicate lines in the history. See bash(1) for more options | |
export HISTCONTROL=ignoredups | |
# ... and ignore same sucessive entries. |
This file contains 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
if [ -f ~/.bashrc ]; then | |
. ~/.bashrc | |
fi | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function proml { | |
local BLUE="\[\033[0;34m\]" |
This file contains 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
#RESQUE | |
#the resque_queue_start.sh contains this script: | |
# cd /web/bmn/; nohup bundle exec rake environment resque:work RAILS_ENV=staging QUEUE=* VERBOSE=1 PIDFILE=/web/bmn/log/resque_queue.pid 2>&1 | |
check process resque_queue with pidfile /var/run/resque_queue.pid | |
start program = "/bin/su - root -c '/etc/redis/resque_queue_start.sh'" | |
stop program = "/bin/sh -c 'cd /web/bmn-dev/ && kill -s QUIT `cat /var/run/resque_queue.pid` && rm -f /var/run/resque_queue.pid; exit 0;'" | |
depends on redis |
This file contains 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 SoundcloudAccount < ActiveRecord::Base | |
belongs_to :user | |
validates_presence_of :user, :on => :create, :message => "can't be blank" | |
validates_uniqueness_of :sc_user_id, :message => "must be unique" | |
def get_tracks | |
if self.sc_user_id.present? | |
client = self.get_client |
This file contains 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
If you switch to kaminari, | |
http://railscasts.com/episodes/254-pagination-with-kaminari | |
...the lines added to application.js become redundant when you implement the pager like in this demo project: | |
https://github.com/amatsuda/kaminari_example/tree/ajax | |
in index.html: |