Commit 926258ee

mo khan <mo@mokhan.ca>
2013-07-26 03:26:02
start to upgrade to rails 4
1 parent e51b50a
app/assets/javascripts/application.js
@@ -1,8 +1,14 @@
-// This is a manifest file that'll be compiled into including all the files listed below.
-// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
-// be included in the compiled file accessible from http://example.com/assets/application.js
+// This is a manifest file that'll be compiled into application.js, which will include all the files
+// listed below.
+//
+// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
+// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
+//
 // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
-// the compiled file.
+// compiled file.
+//
+// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
+// about supported directives.
 //
 //= require jquery
 //= require jquery-migrate
@@ -14,6 +20,7 @@
 //= require jquery.masonry
 //= require jquery-fileupload
 //= require jquery.embedly
+//= require turbolinks
 //= require tag-it
 //= require bootstrap
 //= require_tree .
app/assets/stylesheets/application.css.scss
@@ -1,7 +1,13 @@
 /*
- * This is a manifest file that'll automatically include all the stylesheets available in this directory
- * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
- * the top of the compiled file, but it's generally better to create a new file per style scope.
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
+ * listed below.
+ *
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
+ *
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
+ * compiled file, but it's generally better to create a new file per style scope.
+ *
  *= require colorbox
  *= require jquery.fileupload-ui
  *= require_self
app/controllers/concerns/.gitkeep
app/controllers/application_controller.rb
@@ -1,5 +1,7 @@
 class ApplicationController < ActionController::Base
-  protect_from_forgery
+  # Prevent CSRF attacks by raising an exception.
+  # For APIs, you may want to use :null_session instead.
+  protect_from_forgery with: :exception
   before_filter :profile_application
   before_filter :load_categories
   before_filter :load_user
@@ -15,9 +17,10 @@ class ApplicationController < ActionController::Base
   end
 
   def load_categories
-    @categories = Rails.cache.fetch("categories-#{Category.count}") do
-      Category.all
-    end
+    #@categories = Rails.cache.fetch("categories-#{Category.count}") do
+      #Category.all
+    #end
+    @categories = Category.all
   end
 
   def load_user
app/models/concerns/.gitkeep
app/models/category.rb
@@ -1,7 +1,7 @@
 class Category < ActiveRecord::Base
   has_and_belongs_to_many :creations, :join_table => 'creations_categories'
   attr_accessible :name, :slug
-  default_scope order(:name)
+  default_scope { order(:name) }
 
   def to_param
     slug
app/models/creation.rb
@@ -2,12 +2,12 @@ class Creation < ActiveRecord::Base
   validates :name,  :presence => true
   attr_accessible :user_id, :story, :name, :category_ids, :is_restricted, :watermark
   belongs_to :user, :counter_cache => true
-  has_and_belongs_to_many :categories, :join_table => 'creations_categories', :uniq => true, :autosave => true
-  has_many :photos, :dependent => :destroy, :order => :created_at
+  has_and_belongs_to_many :categories, -> { where unique: true }, :join_table => 'creations_categories', :autosave => true
+  has_many :photos, -> { where :order => :created_at }, :dependent => :destroy
   has_many :favorites, :dependent => :destroy
   acts_as_taggable
 
-  default_scope order("created_at DESC")
+  default_scope { order("created_at DESC") }
 
   # to be removed and moved to the DisplayCreationDTO
   def to_param
app/models/tutorial.rb
@@ -4,7 +4,7 @@ class Tutorial < ActiveRecord::Base
   belongs_to :user
   acts_as_taggable
 
-  default_scope order("created_at DESC")
+  default_scope { order("created_at DESC") }
 
   def to_param
     "#{id}-#{heading.gsub(/[^a-z0-9]+/i, '-')}"
app/models/user.rb
@@ -14,11 +14,12 @@ class User < ActiveRecord::Base
   has_many :creations, :dependent => :destroy
   has_many :favorites, :dependent => :destroy
   has_many :tutorials, :dependent => :destroy
-  has_and_belongs_to_many :interests, :join_table => 'users_interests', :uniq => true, :autosave => true
+  #has_and_belongs_to_many :interests, :join_table => 'users_interests', uniq: true, :autosave => true
+  has_and_belongs_to_many :interests, -> { where unique: true }, :join_table => 'users_interests', :autosave => true
   has_one :avatar
   acts_as_tagger
   before_save :ensure_authentication_token
-  default_scope order("creations_count DESC")
+  default_scope { order("creations_count DESC") }
 
   def add_favorite(creation)
     creation.liked_by(self)
app/views/layouts/application.html.erb
@@ -7,7 +7,7 @@
 <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
 <meta name="google-site-verification" content="X9sZ3dovM2s1pJg68Bb0q1oRqqiJYdzAwGeaGlOy6PM" />
 <meta name="description" content="<%= yield(:description) %>" />
-<%= stylesheet_link_tag :application %>
+<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
 <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.no-icons.min.css" rel="stylesheet">
 <link href="//netdna.bootstrapcdn.com/font-awesome/3.2.1/css/font-awesome.css" rel="stylesheet">
 <%= favicon_link_tag 'favicon.ico' %>
@@ -27,7 +27,7 @@
 <%= render "layouts/footer" %>
 <%= render "layouts/uservoice_feedback"%>
 <%= render "layouts/chrome_frame"%>
-<%= javascript_include_tag :application %>
+<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
 <!--[if lt IE 9]>
   <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
 <![endif]-->
bin/bundle
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+load Gem.bin_path('bundler', 'bundle')
bin/rails
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+APP_PATH = File.expand_path('../../config/application',  __FILE__)
+require_relative '../config/boot'
+require 'rails/commands'
bin/rake
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+require_relative '../config/boot'
+require 'rake'
+Rake.application.run
config/environments/development.rb
@@ -1,41 +1,31 @@
 Cake::Application.configure do
-  # Settings specified here will take precedence over those in config/application.rb
+  # Settings specified here will take precedence over those in config/application.rb.
 
   # In the development environment your application's code is reloaded on
-  # every request.  This slows down response time but is perfect for development
+  # every request. This slows down response time but is perfect for development
   # since you don't have to restart the web server when you make code changes.
   config.cache_classes = false
-  # Log error messages when you accidentally call methods on nil.
-  config.whiny_nils = true
 
-  # Show full error reports and disable caching
+  # Do not eager load code on boot.
+  config.eager_load = false
+
+  # Show full error reports and disable caching.
   config.consider_all_requests_local       = true
   config.action_controller.perform_caching = false
 
-  # Don't care if the mailer can't send
+  # Don't care if the mailer can't send.
   config.action_mailer.raise_delivery_errors = false
 
-  # Print deprecation notices to the Rails logger
+  # Print deprecation notices to the Rails logger.
   config.active_support.deprecation = :log
 
-  # Only use best-standards-support built into browsers
-  config.action_dispatch.best_standards_support = :builtin
-
-  # Do not compress assets
-  config.assets.compress = false
+  # Raise an error on page load if there are pending migrations
+  config.active_record.migration_error = :page_load
 
-  # Expands the lines which load the assets
+  # Debug mode disables concatenation and preprocessing of assets.
+  # This option may cause significant delays in view rendering with a large
+  # number of complex assets.
   config.assets.debug = true
-
-  #config.assets.prefix = "/dev-assets"
-
-  # Raise exception on mass assignment protection for Active Record models
-  config.active_record.mass_assignment_sanitizer = :strict
-
-  # Log the query plan for queries taking more than this (works
-  # with SQLite, MySQL, and PostgreSQL)
-  config.active_record.auto_explain_threshold_in_seconds = 0.5
-
   config.after_initialize do
     Bullet.enable = true
     Bullet.alert = true
config/environments/test.rb
@@ -1,39 +1,37 @@
 Cake::Application.configure do
-  # Settings specified here will take precedence over those in config/application.rb
+  # Settings specified here will take precedence over those in config/application.rb.
 
   # The test environment is used exclusively to run your application's
-  # test suite.  You never need to work with it otherwise.  Remember that
+  # test suite. You never need to work with it otherwise. Remember that
   # your test database is "scratch space" for the test suite and is wiped
-  # and recreated between test runs.  Don't rely on the data there!
-  config.cache_classes = !(ENV['DRB'] == 'true')
+  # and recreated between test runs. Don't rely on the data there!
+  config.cache_classes = true
 
-  # Log error messages when you accidentally call methods on nil.
-  config.whiny_nils = true
+  # Do not eager load code on boot. This avoids loading your whole application
+  # just for the purpose of running a single test. If you are using a tool that
+  # preloads Rails for running tests, you may have to set it to true.
+  config.eager_load = false
 
-  # Show full error reports and disable caching
+  # Configure static asset server for tests with Cache-Control for performance.
+  config.serve_static_assets  = true
+  config.static_cache_control = "public, max-age=3600"
+
+  # Show full error reports and disable caching.
   config.consider_all_requests_local       = true
   config.action_controller.perform_caching = false
 
-  # Raise exceptions instead of rendering exception templates
+  # Raise exceptions instead of rendering exception templates.
   config.action_dispatch.show_exceptions = false
 
-  # Disable request forgery protection in test environment
-  config.action_controller.allow_forgery_protection    = false
+  # Disable request forgery protection in test environment.
+  config.action_controller.allow_forgery_protection = false
 
   # Tell Action Mailer not to deliver emails to the real world.
   # The :test delivery method accumulates sent emails in the
   # ActionMailer::Base.deliveries array.
   config.action_mailer.delivery_method = :test
-
-  # Use SQL instead of Active Record's schema dumper when creating the test database.
-  # This is necessary if your schema can't be completely dumped by the schema dumper,
-  # like if you have constraints or database-specific column types
-  # config.active_record.schema_format = :sql
-
-  # Print deprecation notices to the stderr
-  config.active_support.deprecation = :stderr
   config.action_mailer.default_url_options = { :host => 'www.blah.com'}
 
-  # Raise exception on mass assignment protection for Active Record models
-  config.active_record.mass_assignment_sanitizer = :strict
+  # Print deprecation notices to the stderr.
+  config.active_support.deprecation = :stderr
 end
config/initializers/filter_parameter_logging.rb
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Configure sensitive parameters which will be filtered from the log file.
+Rails.application.config.filter_parameters += [:password]
config/initializers/inflections.rb
@@ -1,10 +1,16 @@
 # Be sure to restart your server when you modify this file.
 
-# Add new inflection rules using the following format
-# (all these examples are active by default):
-# ActiveSupport::Inflector.inflections do |inflect|
+# Add new inflection rules using the following format. Inflections
+# are locale specific, and you may define rules for as many different
+# locales as you wish. All of these examples are active by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
 #   inflect.plural /^(ox)$/i, '\1en'
 #   inflect.singular /^(ox)en/i, '\1'
 #   inflect.irregular 'person', 'people'
 #   inflect.uncountable %w( fish sheep )
 # end
+
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+#   inflect.acronym 'RESTful'
+# end
config/initializers/secret_token.rb
@@ -1,7 +1,12 @@
 # Be sure to restart your server when you modify this file.
 
-# Your secret key for verifying the integrity of signed cookies.
+# Your secret key is used for verifying the integrity of signed cookies.
 # If you change this key, all old signed cookies will become invalid!
+
 # Make sure the secret is at least 30 characters and all random,
 # no regular words or you'll be exposed to dictionary attacks.
-Cake::Application.config.secret_token = ENV['SECRET_TOKEN'] || 'ee46ed305711824ae6bc41f93a02c41d'
+# You can use `rake secret` to generate a secure secret key.
+
+# Make sure your secret_key_base is kept private
+# if you're sharing your code publicly.
+Cake::Application.config.secret_key_base = ENV['SECRET_TOKEN'] || 'b975c91e8211689a2ba7a3df9237f33a70219f9c7e4da3a83c8ebe9165cf98f5645943eb97717c963e366660f19cfcb3018a784835291a1d83a8ffee305678b2'
config/initializers/session_store.rb
@@ -1,8 +1,3 @@
 # Be sure to restart your server when you modify this file.
 
-Cake::Application.config.session_store :cookie_store, :key => '_cake_eater'
-
-# Use the database for sessions instead of the cookie-based default,
-# which shouldn't be used to store highly confidential information
-# (create the session table with "rails generate session_migration")
-# Cake::Application.config.session_store :active_record_store
+Cake::Application.config.session_store :cookie_store, key: '_cake_eater'
config/initializers/wrap_parameters.rb
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+  wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
+end
+
+# To enable root element in JSON for ActiveRecord objects.
+# ActiveSupport.on_load(:active_record) do
+#  self.include_root_in_json = true
+# end
config/locales/en.yml
@@ -1,5 +1,23 @@
-# Sample localization file for English. Add more files in this directory for other locales.
-# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
+# Files in the config/locales directory are used for internationalization
+# and are automatically loaded by Rails. If you want to use locales other
+# than English, add the necessary files in this directory.
+#
+# To use the locales, use `I18n.t`:
+#
+#     I18n.t 'hello'
+#
+# In views, this is aliased to just `t`:
+#
+#     <%= t('hello') %>
+#
+# To use a different locale, set it with `I18n.locale`:
+#
+#     I18n.locale = :es
+#
+# This would use the information in config/locales/es.yml.
+#
+# To learn more, please read the Rails Internationalization guide
+# available at http://guides.rubyonrails.org/i18n.html.
 
 en:
   hello: "Hello world"
config/application.rb
@@ -1,13 +1,15 @@
 require File.expand_path('../boot', __FILE__)
 
-require 'rails/all'
+# Pick the frameworks you want:
+require "active_record/railtie"
+require "action_controller/railtie"
+require "action_mailer/railtie"
+require "sprockets/railtie"
+# require "rails/test_unit/railtie"
 
-if defined?(Bundler)
-  # If you precompile assets before deploying to production, use this line
-  Bundler.require *Rails.groups(:assets => %w(development test))
-  # If you want your assets lazily compiled in production, use this line
-  # Bundler.require(:default, :assets, Rails.env)
-end
+# Require the gems listed in Gemfile, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(:default, Rails.env)
 
 module Cake
   class Application < Rails::Application
@@ -22,13 +24,6 @@ module Cake
     config.autoload_paths += %W(#{config.root}/app/services/mappers)
     config.autoload_paths += %W(#{config.root}/app/services/queries)
 
-    # Only load the plugins named here, in the order given (default is alphabetical).
-    # :all can be used as a placeholder for all plugins not explicitly named.
-    # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
-
-    # Activate observers that should always be running.
-    # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
-
     # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
     # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
     # config.time_zone = 'Central Time (US & Canada)'
@@ -37,20 +32,6 @@ module Cake
     # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
     # config.i18n.default_locale = :de
 
-    # Configure the default encoding used in templates for Ruby 1.9.
-    config.encoding = "utf-8"
-
-    # Configure sensitive parameters which will be filtered from the log file.
-    config.filter_parameters += [:password]
-
-    # Enable the asset pipeline
-    config.assets.enabled = true
-
-    # Version of your assets, change this if you want to expire all your assets
-    config.assets.version = '1.0'
-
-    config.assets.initialize_on_precompile = false
-
     config.to_prepare {
       Devise::SessionsController.layout "application"
       # Devise::RegistrationsController.layout proc{ |controller| user_signed_in? ? "application" : "users" }
config/boot.rb
@@ -1,5 +1,3 @@
-require 'rubygems'
-
 # Set up gems listed in the Gemfile.
 ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
 
config/routes.rb
@@ -1,7 +1,7 @@
 Cake::Application.routes.draw do
   # /home
-  match "about_us" => "home#about_us"
-  match "why_cakeside" => "home#why_cakeside"
+  get "about_us" => "home#about_us"
+  get "why_cakeside" => "home#why_cakeside"
 
   resources :tutorials do
     get 'page/:page', :action => :index, :on => :collection
@@ -22,7 +22,7 @@ Cake::Application.routes.draw do
   resources :profiles, :only => [:index, :show] do
     get 'page/:page', :action => :index, :on => :collection
   end
-  match 'favorites' => 'profiles#favorites', :as => 'profiles_favorites', :method => 'GET'
+  get 'favorites' => 'profiles#favorites', :as => 'profiles_favorites'
 
   # /categories
   get 'categories/:slug' => "categories#show", :as => :category
@@ -38,11 +38,12 @@ Cake::Application.routes.draw do
   get "search" => 'search#index'
 
   # /users
-  devise_for :users, :controllers => {:registrations => 'registrations'}
-  devise_for :user, :path => '', :path_names => { :sign_in => "login", :sign_out => "logout", :sign_up => "register" }
+  #devise_for :users, :controllers => {:registrations => 'registrations'}
+  #devise_for :user, :path => '', :path_names => { :sign_in => "login", :sign_out => "logout", :sign_up => "register" }
+  devise_for :users, :controllers => {:registrations => 'registrations'}, :path => '', :path_names => { :sign_in => "login", :sign_out => "logout", :sign_up => "register" }
 
   # sitemap
-  match "/sitemap.xml", :to => "sitemap#index", :defaults => {:format => :xml}
+  get "/sitemap.xml", :to => "sitemap#index", :defaults => {:format => :xml}
 
   resources :settings, :only => [:index, :update]
   resources :passwords, :only => [:index, :update], :path => :pwd
spec/models/creation_spec.rb
@@ -1,7 +1,7 @@
 require 'spec_helper'
 
 describe Creation do
-  let(:sut) { FactoryGirl.create(:creation) }
+  let(:sut) { Creation.new }
 
   describe "should be able to set attributes" do
     it "should save name" do
config.ru
@@ -1,4 +1,4 @@
 # This file is used by Rack-based servers to start the application.
 
 require ::File.expand_path('../config/environment',  __FILE__)
-run Cake::Application
+run Rails.application
Gemfile
@@ -1,42 +1,52 @@
 source 'https://rubygems.org'
 
-gem 'rails'
-gem 'rake'
-gem 'devise'
+gem 'rails', '4.0.0'
+gem 'sass-rails', '~> 4.0.0'
+gem 'uglifier', '>= 1.3.0'
+gem 'coffee-rails', '~> 4.0.0'
 gem 'jquery-rails'
+gem 'turbolinks'
+gem 'jbuilder', '~> 1.2'
+group :doc do
+  # bundle exec rake doc:rails generates the API under doc/api.
+  gem 'sdoc', require: false
+end
+
+gem 'devise'
 gem 'jquery-ui-rails'
 gem 'carrierwave'
 gem 'carrierwave_backgrounder'
 gem 'rmagick'
 gem 'kaminari'
-gem "formtastic"
-gem 'sass-rails'
+#gem "formtastic"
 gem 'bootstrap-sass'
 gem 'acts-as-taggable-on'
-gem 'delayed_job_active_record'
+gem 'delayed_job', "~> 4.0.0.beta2"
+gem 'delayed_job_active_record', "~> 4.0.0.beta3"
 gem 'daemons'
 gem 'jquery-fileupload-rails'
-gem 'capistrano-gitflow'
 gem 'dotenv-rails'
 gem 'airbrake'
 gem 'geocoder'
-gem 'jbuilder'
 gem 'pg'
-gem 'sass-rails'
-gem 'coffee-rails'
-gem 'uglifier'
 gem 'asset_sync'
+gem 'protected_attributes'
 
-group :development, :test do
-  gem 'rspec-rails'
-  gem 'jasmine'
+group :development do
   gem 'capistrano'
   gem 'capistrano-ext'
   gem 'rvm-capistrano'
-  gem 'better_errors'
+  gem 'capistrano-gitflow'
   gem 'bullet'
-  gem 'rack-mini-profiler'
+  gem 'better_errors'
   gem 'lol_dba'
+end
+
+group :development, :test do
+  gem 'sqlite3'
+  gem 'rspec-rails'
+  gem 'jasmine'
+  gem 'rack-mini-profiler'
   gem 'database_cleaner'
   gem 'factory_girl_rails'
   gem 'capybara'
Gemfile.lock
@@ -1,50 +1,48 @@
 GEM
   remote: https://rubygems.org/
   specs:
-    actionmailer (3.2.14)
-      actionpack (= 3.2.14)
-      mail (~> 2.5.4)
-    actionpack (3.2.14)
-      activemodel (= 3.2.14)
-      activesupport (= 3.2.14)
-      builder (~> 3.0.0)
+    actionmailer (4.0.0)
+      actionpack (= 4.0.0)
+      mail (~> 2.5.3)
+    actionpack (4.0.0)
+      activesupport (= 4.0.0)
+      builder (~> 3.1.0)
       erubis (~> 2.7.0)
-      journey (~> 1.0.4)
-      rack (~> 1.4.5)
-      rack-cache (~> 1.2)
-      rack-test (~> 0.6.1)
-      sprockets (~> 2.2.1)
-    activemodel (3.2.14)
-      activesupport (= 3.2.14)
-      builder (~> 3.0.0)
-    activerecord (3.2.14)
-      activemodel (= 3.2.14)
-      activesupport (= 3.2.14)
-      arel (~> 3.0.2)
-      tzinfo (~> 0.3.29)
-    activeresource (3.2.14)
-      activemodel (= 3.2.14)
-      activesupport (= 3.2.14)
-    activesupport (3.2.14)
+      rack (~> 1.5.2)
+      rack-test (~> 0.6.2)
+    activemodel (4.0.0)
+      activesupport (= 4.0.0)
+      builder (~> 3.1.0)
+    activerecord (4.0.0)
+      activemodel (= 4.0.0)
+      activerecord-deprecated_finders (~> 1.0.2)
+      activesupport (= 4.0.0)
+      arel (~> 4.0.0)
+    activerecord-deprecated_finders (1.0.3)
+    activesupport (4.0.0)
       i18n (~> 0.6, >= 0.6.4)
-      multi_json (~> 1.0)
+      minitest (~> 4.2)
+      multi_json (~> 1.3)
+      thread_safe (~> 0.1)
+      tzinfo (~> 0.3.37)
     acts-as-taggable-on (2.4.1)
       rails (>= 3, < 5)
     airbrake (3.1.12)
       activesupport
       builder
       json
-    arel (3.0.2)
-    asset_sync (0.5.4)
+    arel (4.0.0)
+    asset_sync (0.6.0)
       activemodel
-      fog
+      fog (>= 1.8.0)
+    atomic (1.1.10)
     bcrypt-ruby (3.1.1)
     better_errors (0.9.0)
       coderay (>= 1.0.0)
       erubis (>= 2.6.6)
     bootstrap-sass (2.3.2.1)
       sass (~> 3.2)
-    builder (3.0.4)
+    builder (3.1.4)
     bullet (4.6.0)
       uniform_notifier
     capistrano (2.15.5)
@@ -73,9 +71,9 @@ GEM
     childprocess (0.3.9)
       ffi (~> 1.0, >= 1.0.11)
     coderay (1.0.9)
-    coffee-rails (3.2.2)
+    coffee-rails (4.0.0)
       coffee-script (>= 2.2.0)
-      railties (~> 3.2.0)
+      railties (>= 4.0.0.beta, < 5.0)
     coffee-script (2.2.0)
       coffee-script-source
       execjs
@@ -83,11 +81,11 @@ GEM
     daemons (1.1.9)
     dalli (2.6.4)
     database_cleaner (1.0.1)
-    delayed_job (3.0.5)
-      activesupport (~> 3.0)
-    delayed_job_active_record (0.4.4)
-      activerecord (>= 2.1.0, < 4)
-      delayed_job (~> 3.0)
+    delayed_job (4.0.0.beta2)
+      activesupport (>= 3.0, < 4.1)
+    delayed_job_active_record (4.0.0.beta3)
+      activerecord (>= 3.0, < 4.1)
+      delayed_job (>= 3.0, < 4.1)
     devise (3.0.0)
       bcrypt-ruby (~> 3.0)
       orm_adapter (~> 0.1)
@@ -122,8 +120,6 @@ GEM
       nokogiri (~> 1.5)
       ruby-hmac
     formatador (0.2.4)
-    formtastic (2.2.1)
-      actionpack (>= 3.0)
     geocoder (1.1.8)
     highline (1.6.19)
     hike (1.2.3)
@@ -137,7 +133,6 @@ GEM
     jbuilder (1.4.2)
       activesupport (>= 3.0.0)
       multi_json (>= 1.2.0)
-    journey (1.0.4)
     jquery-fileupload-rails (0.4.1)
       actionpack (>= 3.1)
       railties (>= 3.1)
@@ -160,6 +155,7 @@ GEM
       treetop (~> 1.4.8)
     mime-types (1.23)
     mini_portile (0.5.1)
+    minitest (4.7.5)
     multi_json (1.7.7)
     net-scp (1.1.2)
       net-ssh (>= 2.6.5)
@@ -174,30 +170,26 @@ GEM
     orm_adapter (0.4.0)
     pg (0.16.0)
     polyglot (0.3.3)
-    rack (1.4.5)
-    rack-cache (1.2)
-      rack (>= 0.4)
+    protected_attributes (1.0.3)
+      activemodel (>= 4.0.0, < 5.0)
+    rack (1.5.2)
     rack-mini-profiler (0.1.27)
       rack (>= 1.1.3)
-    rack-ssl (1.3.3)
-      rack
     rack-test (0.6.2)
       rack (>= 1.0)
-    rails (3.2.14)
-      actionmailer (= 3.2.14)
-      actionpack (= 3.2.14)
-      activerecord (= 3.2.14)
-      activeresource (= 3.2.14)
-      activesupport (= 3.2.14)
-      bundler (~> 1.0)
-      railties (= 3.2.14)
-    railties (3.2.14)
-      actionpack (= 3.2.14)
-      activesupport (= 3.2.14)
-      rack-ssl (~> 1.3.2)
+    rails (4.0.0)
+      actionmailer (= 4.0.0)
+      actionpack (= 4.0.0)
+      activerecord (= 4.0.0)
+      activesupport (= 4.0.0)
+      bundler (>= 1.3.0, < 2.0)
+      railties (= 4.0.0)
+      sprockets-rails (~> 2.0.0)
+    railties (4.0.0)
+      actionpack (= 4.0.0)
+      activesupport (= 4.0.0)
       rake (>= 0.8.7)
-      rdoc (~> 3.4)
-      thor (>= 0.14.6, < 2.0)
+      thor (>= 0.18.1, < 2.0)
     rake (10.1.0)
     rdoc (3.12.2)
       json (~> 1.4)
@@ -222,10 +214,13 @@ GEM
     rvm-capistrano (1.4.1)
       capistrano (>= 2.0.0)
     sass (3.2.9)
-    sass-rails (3.2.6)
-      railties (~> 3.2.0)
+    sass-rails (4.0.0)
+      railties (>= 4.0.0.beta, < 5.0)
       sass (>= 3.1.10)
-      tilt (~> 1.3)
+      sprockets-rails (~> 2.0.0)
+    sdoc (0.3.20)
+      json (>= 1.1.3)
+      rdoc (~> 3.10)
     selenium-webdriver (2.33.0)
       childprocess (>= 0.2.5)
       multi_json (~> 1.0)
@@ -235,17 +230,26 @@ GEM
       multi_json (~> 1.0)
       simplecov-html (~> 0.7.1)
     simplecov-html (0.7.1)
-    sprockets (2.2.2)
+    sprockets (2.10.0)
       hike (~> 1.2)
       multi_json (~> 1.0)
       rack (~> 1.0)
       tilt (~> 1.1, != 1.3.0)
+    sprockets-rails (2.0.0)
+      actionpack (>= 3.0)
+      activesupport (>= 3.0)
+      sprockets (~> 2.8)
+    sqlite3 (1.3.7)
     stringex (2.0.6)
     thor (0.18.1)
+    thread_safe (0.1.2)
+      atomic
     tilt (1.4.1)
     treetop (1.4.14)
       polyglot
       polyglot (>= 0.3.1)
+    turbolinks (1.3.0)
+      coffee-rails
     tzinfo (0.3.37)
     uglifier (2.1.2)
       execjs (>= 0.3.0)
@@ -273,21 +277,21 @@ DEPENDENCIES
   capybara
   carrierwave
   carrierwave_backgrounder
-  coffee-rails
+  coffee-rails (~> 4.0.0)
   daemons
   dalli
   database_cleaner
-  delayed_job_active_record
+  delayed_job (~> 4.0.0.beta2)
+  delayed_job_active_record (~> 4.0.0.beta3)
   devise
   dotenv-rails
   factory_girl_rails
   fakes-rspec
   ffaker
   fog
-  formtastic
   geocoder
   jasmine
-  jbuilder
+  jbuilder (~> 1.2)
   jquery-fileupload-rails
   jquery-rails
   jquery-ui-rails
@@ -295,12 +299,15 @@ DEPENDENCIES
   lol_dba
   newrelic_rpm
   pg
+  protected_attributes
   rack-mini-profiler
-  rails
-  rake
+  rails (= 4.0.0)
   rmagick
   rspec-rails
   rvm-capistrano
-  sass-rails
+  sass-rails (~> 4.0.0)
+  sdoc
   simplecov
-  uglifier
+  sqlite3
+  turbolinks
+  uglifier (>= 1.3.0)
Rakefile
@@ -2,7 +2,7 @@
 # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
 
 require File.expand_path('../config/application', __FILE__)
-require 'rake'
+#require 'rake'
 require 'dotenv/tasks'
 
 Cake::Application.load_tasks