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
# Symlink the ondeck database.yml to database.yml.example | |
# .ebextensions/database_yml.config | |
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/pre/01a_symlink_database_yml.sh": | |
mode: "000777" | |
content: | | |
#!/bin/bash | |
cd /var/app/ondeck/config | |
ln -sf database.sample.yml database.yml |
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 Rubber::Util.has_asset_pipeline? | |
# load 'deploy/assets' | |
_cset :asset_env, "RAILS_GROUPS=assets" | |
_cset :assets_prefix, "assets" | |
_cset :assets_role, [:app] | |
_cset :normalize_asset_timestamps, false | |
before 'deploy:finalize_update', 'deploy:assets:symlink' |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
# encoding: UTF-8 | |
# Place in config/deploy.rb | |
# See: https://gist.github.com/joost/9343156 | |
# Adapted to work with rbenv | |
namespace :rails do | |
desc "Open the rails console on primary app server" | |
task :console do | |
on roles(:app), primary: true do | |
rails_env = fetch(:stage) | |
execute_interactively "#{bundle_cmd} #{current_path}/script/rails console #{rails_env}" |
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 User < ActiveRecord::Base | |
alias :devise_valid_password? :valid_password? | |
def valid_password?(password) | |
begin | |
devise_valid_password?(password) | |
rescue BCrypt::Errors::InvalidHash | |
return false unless Digest::SHA1.hexdigest(password) == encrypted_password | |
logger.info "User #{email} is using the old password hashing method, updating attribute." | |
self.password = password |