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
| # Gemfile | |
| … | |
| gem 'uuidtools' | |
| … |
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
| private | |
| def force_ssl | |
| if Rails.env.production? | |
| if !request.ssl? | |
| redirect_to :protocol => 'https' | |
| end | |
| end | |
| end |
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 User < ActiveRecord::Base | |
| def update_with_password(params, *options) | |
| _current_password = params[:current_password] | |
| _password = params[:password] | |
| _password_confirmation = params[:password_confirmation] | |
| unless _current_password.blank? | |
| if _password.blank? | |
| errors.add(:password, "can't be blank") | |
| false | |
| else |
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
| def wait_for_ajax(timeout = 5) #Timeout in seconds | |
| page.wait_until(timeout) do | |
| page.evaluate_script "angular.element.active == 0 && jQuery.active == 0" | |
| end | |
| end | |
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
| def fill_in_tinymce(frame_id, options) | |
| page.execute_script(%{tinyMCE.editors['tinymce-#{frame_id}'].setContent('#{options[:with]}')}) | |
| end | |
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
| # alias to macvim for ruby support | |
| alias vim='/Applications/MacVim.app/Contents/MacOS/Vim' |
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
| set t_Co=256 | |
| set shell=bash | |
| set nocompatible " be iMproved | |
| filetype off " required! | |
| set rtp+=~/.vim/bundle/vundle/ | |
| call vundle#rc() | |
| Bundle 'gmarik/vundle' | |
| if filereadable(expand('~/.vim/Vunfile')) | |
| source ~/.vim/Vunfile |
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
| # Disable Rails's static asset server (Apache or nginx will already do this) | |
| config.serve_static_assets = true | |
| config.middleware.insert_after(::Rack::Lock, "::Rack::Auth::Basic", "Staging") do |u, p| | |
| [u, p] == [ENV['BASIC_AUTH_USER'], ENV['BASIC_AUTH_PASSWORD']] | |
| end |
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
| group :development, :test do | |
| # require false fixes ActiveRecord::AssociationTypeMismatch | |
| # gem 'factory_girl', :require => false | |
| gem 'factory_girl_rails', :require => false | |
| end |
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 ApplicationController < ActionController::Base | |
| protect_from_forgery # See ActionController::RequestForgeryProtection for details | |
| before_filter lambda { | |
| ActionMailer::Base.default_url_options = {:host => request.host_with_port} | |
| } | |
| end |