autocmd BufWritePre * :%s/\s\+$//e
(add-hook 'before-save-hook 'delete-trailing-whitespace)
Factory.define :account_with_users do |ac| | |
ac.sequence(:name) { |n| "Account#{n}" } | |
ac.sequence(:subdomain) { |n| "subdomain#{n}" } | |
ac.after_build do |account| | |
account.users = [Factory.build(:user),Factory.build(:user)] | |
end | |
end | |
Factory.define :user do |u| | |
u.sequence(:name) { |n| "John Doe #{n}" } |
# Author: Michael van Rooijen | |
# Description: | |
# This recipe is designed to work for people using Phusion Passenger, | |
# Git as your repository. | |
# | |
# The script (initially) does the following: | |
# - It first (after you run cap:deploy setup) will set up the capistrano environment on your remote machine | |
# - After that, it will sync your current database.yml file to the "shared" location on the remote machine | |
# - You are now basically ready to deploy. | |
# - Once you run "cap:deploy" it will start the deployment |
before "deploy:rollback:revision", "deploy:rollback_database" | |
desc "Rolls back database to migration level of the previously deployed release" | |
task :rollback_database, :roles => :db, :only => { :primary => true } do | |
if releases.length < 2 | |
abort "could not rollback the code because there is no prior release" | |
else | |
rake = fetch(:rake, "rake") | |
rails_env = fetch(:rails_env, "production") | |
migrate_env = fetch(:migrate_env, "") |