Commit 9ee219bb

mo khan <mo@mokhan.ca>
2014-08-22 03:29:43
upgrade to rails 4.1
1 parent 7a1927b
config/environments/development.rb
@@ -1,4 +1,4 @@
-Cake::Application.configure do
+Rails.application.configure do
   # Settings specified here will take precedence over those in config/application.rb.
 
   # In the development environment your application's code is reloaded on
@@ -27,6 +27,14 @@ Cake::Application.configure do
   # number of complex assets.
   config.assets.debug = true
 
+  # Adds additional error checking when serving assets at runtime.
+  # Checks for improperly declared sprockets dependencies.
+  # Raises helpful error messages.
+  config.assets.raise_runtime_errors = true
+
+  # Raises error for missing translations
+  # config.action_view.raise_on_missing_translations = true
+
   config.action_mailer.default_url_options = { :host => "localhost:3000" }
   config.action_mailer.smtp_settings = {
     :address              => ENV['SMTP_HOST'],
config/environments/test.rb
@@ -1,4 +1,4 @@
-Cake::Application.configure do
+Rails.application.configure do
   # Settings specified here will take precedence over those in config/application.rb.
 
   # The test environment is used exclusively to run your application's
@@ -34,4 +34,7 @@ Cake::Application.configure do
 
   # Print deprecation notices to the stderr.
   config.active_support.deprecation = :stderr
+
+  # Raises error for missing translations
+  # config.action_view.raise_on_missing_translations = true
 end
config/initializers/assets.rb
@@ -0,0 +1,8 @@
+# Be sure to restart your server when you modify this file.
+
+# Version of your assets, change this if you want to expire all your assets.
+Rails.application.config.assets.version = '1.0'
+
+# Precompile additional assets.
+# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
+# Rails.application.config.assets.precompile += %w( search.js )
config/initializers/cookies_serializer.rb
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.action_dispatch.cookies_serializer = :json
config/initializers/secret_token.rb
@@ -1,12 +0,0 @@
-# Be sure to restart your server when you modify this file.
-
-# 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.
-# 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/application.rb
@@ -1,15 +1,17 @@
 require File.expand_path('../boot', __FILE__)
 
 # Pick the frameworks you want:
+require "active_model/railtie"
 require "active_record/railtie"
 require "action_controller/railtie"
 require "action_mailer/railtie"
+require "action_view/railtie"
 require "sprockets/railtie"
 # require "rails/test_unit/railtie"
 
 # Require the gems listed in Gemfile, including any gems
 # you've limited to :test, :development, or :production.
-Bundler.require(:default, Rails.env)
+Bundler.require(*Rails.groups)
 
 module Cake
   class Application < Rails::Application
config/environment.rb
@@ -2,6 +2,6 @@
 require File.expand_path('../application', __FILE__)
 
 # Initialize the rails application
-Cake::Application.initialize!
+Rails.application.initialize!
 Date::DATE_FORMATS[:foomat] = "%d/%m/%Y"
 Time::DATE_FORMATS[:foomat] = "%B. %d, %Y"
config/secrets.yml
@@ -0,0 +1,22 @@
+# Be sure to restart your server when you modify this file.
+
+# 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.
+# You can use `rake secret` to generate a secure secret key.
+
+# Make sure the secrets in this file are kept private
+# if you're sharing your code publicly.
+
+development:
+  secret_key_base: 5a8d8856ac7ff89a031cc8370020c03f48be94e1d52a2ad02848bd27b1e8864f6c87626203b464b53d6ab9ed1c0e63d068b4b13a9998eb67105b1c2a5df071c3
+
+test:
+  secret_key_base: a275a537c6ab6aedf787c652911b1f6d4ba733f12d07df51e5d1bebc134cef1bf750462cd338493d08c305a8764e3889f73e218e9f83d5add377b0282dd959e4
+
+# Do not keep production secrets in the repository,
+# instead read values from the environment.
+production:
+  secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
db/migrate/20140822032548_add_missing_unique_indices.acts_as_taggable_on_engine.rb
@@ -0,0 +1,20 @@
+# This migration comes from acts_as_taggable_on_engine (originally 2)
+class AddMissingUniqueIndices < ActiveRecord::Migration
+  def self.up
+    add_index :tags, :name, unique: true
+
+    remove_index :taggings, :tag_id
+    remove_index :taggings, [:taggable_id, :taggable_type, :context]
+    add_index :taggings,
+              [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type],
+              unique: true, name: 'taggings_idx'
+  end
+
+  def self.down
+    remove_index :tags, :name
+
+    remove_index :taggings, name: 'taggings_idx'
+    add_index :taggings, :tag_id
+    add_index :taggings, [:taggable_id, :taggable_type, :context]
+  end
+end
db/migrate/20140822032549_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb
@@ -0,0 +1,15 @@
+# This migration comes from acts_as_taggable_on_engine (originally 3)
+class AddTaggingsCounterCacheToTags < ActiveRecord::Migration
+  def self.up
+    add_column :tags, :taggings_count, :integer, default: 0
+
+    ActsAsTaggableOn::Tag.reset_column_information
+    ActsAsTaggableOn::Tag.find_each do |tag|
+      ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings)
+    end
+  end
+
+  def self.down
+    remove_column :tags, :taggings_count
+  end
+end
db/migrate/20140822032550_add_missing_taggable_index.acts_as_taggable_on_engine.rb
@@ -0,0 +1,10 @@
+# This migration comes from acts_as_taggable_on_engine (originally 4)
+class AddMissingTaggableIndex < ActiveRecord::Migration
+  def self.up
+    add_index :taggings, [:taggable_id, :taggable_type, :context]
+  end
+
+  def self.down
+    remove_index :taggings, [:taggable_id, :taggable_type, :context]
+  end
+end
db/schema.rb
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended that you check this file into your version control system.
 
-ActiveRecord::Schema.define(version: 20140816190202) do
+ActiveRecord::Schema.define(version: 20140822032550) do
 
   # These are extensions that must be enabled in order to support this database
   enable_extension "plpgsql"
@@ -134,16 +134,19 @@ ActiveRecord::Schema.define(version: 20140816190202) do
     t.datetime "created_at"
   end
 
-  add_index "taggings", ["tag_id"], name: "index_taggings_on_tag_id", using: :btree
+  add_index "taggings", ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true, using: :btree
   add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context", using: :btree
   add_index "taggings", ["taggable_type"], name: "index_taggings_on_taggable_type", using: :btree
   add_index "taggings", ["tagger_id"], name: "index_taggings_on_tagger_id", using: :btree
   add_index "taggings", ["tagger_type"], name: "index_taggings_on_tagger_type", using: :btree
 
   create_table "tags", force: true do |t|
-    t.string "name"
+    t.string  "name"
+    t.integer "taggings_count", default: 0
   end
 
+  add_index "tags", ["name"], name: "index_tags_on_name", unique: true, using: :btree
+
   create_table "tutorials", force: true do |t|
     t.string   "heading"
     t.text     "description"
public/robots.txt
@@ -1,5 +1,5 @@
-# www.robotstxt.org/
-# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449
-
+# See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
+#
+# To ban all spiders from the entire site uncomment the next two lines:
 User-agent: *
 
Gemfile
@@ -1,14 +1,19 @@
 source 'https://rubygems.org'
 
-gem 'rails', '~> 4.0.8'
-gem 'sass-rails', '~> 4.0'
+#gem 'rails', '~> 4.0.8'
+gem 'rails', '4.1.4'
+#gem 'sass-rails', '~> 4.0'
+gem 'sass-rails', '~> 4.0.3'
+#gem 'uglifier', '>= 1.3.0'
 gem 'uglifier', '>= 1.3.0'
-gem 'coffee-rails', '~> 4.0'
+#gem 'coffee-rails', '~> 4.0'
+gem 'coffee-rails', '~> 4.0.0'
 gem 'jquery-rails'
-gem 'jbuilder', '~> 1.2'
+#gem 'jbuilder', '~> 1.2'
+gem 'jbuilder', '~> 2.0'
 group :doc do
   # bundle exec rake doc:rails generates the API under doc/api.
-  gem 'sdoc', require: false
+  gem 'sdoc', '~> 0.4.0'
 end
 
 gem 'devise', '~> 3.0.0'
@@ -18,7 +23,7 @@ gem 'rmagick', '~> 2.13.0'
 gem 'mini_magick'
 gem "kaminari", "~> 0.15.0"
 gem 'bootstrap-sass', '~> 2.3.0'
-gem 'acts-as-taggable-on', '~> 2.4.1'
+gem 'acts-as-taggable-on', '~> 3.3.0'
 gem 'delayed_job', "~> 4.0.0"
 gem 'delayed_job_active_record', "~> 4.0.0"
 gem 'daemons', '~> 1.1.9'
@@ -43,6 +48,7 @@ group :development do
   gem 'bullet'
   gem 'better_errors'
   gem 'lol_dba'
+  gem 'spring'
 end
 
 group :development, :test do
Gemfile.lock
@@ -1,34 +1,36 @@
 GEM
   remote: https://rubygems.org/
   specs:
-    actionmailer (4.0.8)
-      actionpack (= 4.0.8)
+    actionmailer (4.1.4)
+      actionpack (= 4.1.4)
+      actionview (= 4.1.4)
       mail (~> 2.5.4)
-    actionpack (4.0.8)
-      activesupport (= 4.0.8)
-      builder (~> 3.1.0)
-      erubis (~> 2.7.0)
+    actionpack (4.1.4)
+      actionview (= 4.1.4)
+      activesupport (= 4.1.4)
       rack (~> 1.5.2)
       rack-test (~> 0.6.2)
-    activemodel (4.0.8)
-      activesupport (= 4.0.8)
-      builder (~> 3.1.0)
-    activerecord (4.0.8)
-      activemodel (= 4.0.8)
-      activerecord-deprecated_finders (~> 1.0.2)
-      activesupport (= 4.0.8)
-      arel (~> 4.0.0)
-    activerecord-deprecated_finders (1.0.3)
-    activesupport (4.0.8)
+    actionview (4.1.4)
+      activesupport (= 4.1.4)
+      builder (~> 3.1)
+      erubis (~> 2.7.0)
+    activemodel (4.1.4)
+      activesupport (= 4.1.4)
+      builder (~> 3.1)
+    activerecord (4.1.4)
+      activemodel (= 4.1.4)
+      activesupport (= 4.1.4)
+      arel (~> 5.0.0)
+    activesupport (4.1.4)
       i18n (~> 0.6, >= 0.6.9)
-      minitest (~> 4.2)
-      multi_json (~> 1.3)
+      json (~> 1.7, >= 1.7.7)
+      minitest (~> 5.1)
       thread_safe (~> 0.1)
-      tzinfo (~> 0.3.37)
-    acts-as-taggable-on (2.4.1)
-      rails (>= 3, < 5)
+      tzinfo (~> 1.1)
+    acts-as-taggable-on (3.3.0)
+      activerecord (>= 3, < 5)
     addressable (2.3.6)
-    arel (4.0.2)
+    arel (5.0.1.20140414130214)
     asset_sync (1.0.0)
       activemodel
       fog (>= 1.8.0)
@@ -46,7 +48,7 @@ GEM
     bootstrap-sass (2.3.2.2)
       sass (~> 3.2)
     buftok (0.2.0)
-    builder (3.1.4)
+    builder (3.2.2)
     bullet (4.13.1)
       activesupport (>= 3.0.0)
       uniform_notifier (>= 1.6.0)
@@ -152,12 +154,12 @@ GEM
     httparty (0.13.1)
       json (~> 1.8)
       multi_xml (>= 0.5.2)
-    i18n (0.6.9)
+    i18n (0.6.11)
     inflecto (0.0.2)
     ipaddress (0.8.0)
-    jbuilder (1.5.3)
-      activesupport (>= 3.0.0)
-      multi_json (>= 1.2.0)
+    jbuilder (2.1.3)
+      activesupport (>= 3.0.0, < 5)
+      multi_json (~> 1.2)
     jquery-rails (3.1.1)
       railties (>= 3.0, < 5.0)
       thor (>= 0.14, < 2.0)
@@ -184,7 +186,7 @@ GEM
     mini_magick (3.7.0)
       subexec (~> 0.2.1)
     mini_portile (0.6.0)
-    minitest (4.7.5)
+    minitest (5.4.0)
     multi_json (1.10.1)
     multi_xml (0.5.5)
     multipart-post (2.0.0)
@@ -210,17 +212,19 @@ GEM
     rack (1.5.2)
     rack-test (0.6.2)
       rack (>= 1.0)
-    rails (4.0.8)
-      actionmailer (= 4.0.8)
-      actionpack (= 4.0.8)
-      activerecord (= 4.0.8)
-      activesupport (= 4.0.8)
+    rails (4.1.4)
+      actionmailer (= 4.1.4)
+      actionpack (= 4.1.4)
+      actionview (= 4.1.4)
+      activemodel (= 4.1.4)
+      activerecord (= 4.1.4)
+      activesupport (= 4.1.4)
       bundler (>= 1.3.0, < 2.0)
-      railties (= 4.0.8)
+      railties (= 4.1.4)
       sprockets-rails (~> 2.0)
-    railties (4.0.8)
-      actionpack (= 4.0.8)
-      activesupport (= 4.0.8)
+    railties (4.1.4)
+      actionpack (= 4.1.4)
+      activesupport (= 4.1.4)
       rake (>= 0.8.7)
       thor (>= 0.18.1, < 2.0)
     raindrops (0.13.0)
@@ -266,6 +270,7 @@ GEM
       simplecov-html (~> 0.8.0)
     simplecov-html (0.8.0)
     spank (0.0.1393558686)
+    spring (1.1.3)
     sprockets (2.11.0)
       hike (~> 1.2)
       multi_json (~> 1.0)
@@ -296,7 +301,8 @@ GEM
       memoizable (~> 0.4.0)
       naught (~> 1.0)
       simple_oauth (~> 0.2.0)
-    tzinfo (0.3.39)
+    tzinfo (1.2.2)
+      thread_safe (~> 0.1)
     uglifier (2.5.1)
       execjs (>= 0.3.0)
       json (>= 1.8.0)
@@ -319,7 +325,7 @@ PLATFORMS
   ruby
 
 DEPENDENCIES
-  acts-as-taggable-on (~> 2.4.1)
+  acts-as-taggable-on (~> 3.3.0)
   asset_sync (~> 1.0.0)
   aws-sdk (~> 1.42.0)
   better_errors
@@ -330,7 +336,7 @@ DEPENDENCIES
   capistrano-ext (~> 1.2.1)
   capybara
   carrierwave (~> 0.9.0)
-  coffee-rails (~> 4.0)
+  coffee-rails (~> 4.0.0)
   daemons (~> 1.1.9)
   dalli
   database_cleaner
@@ -347,7 +353,7 @@ DEPENDENCIES
   fog
   foreman
   gibbon (~> 1.1.2)
-  jbuilder (~> 1.2)
+  jbuilder (~> 2.0)
   jquery-rails
   jquery-ui-rails (~> 4.0.0)
   js-routes (~> 0.9.8)
@@ -358,14 +364,15 @@ DEPENDENCIES
   newrelic_rpm
   pg
   poltergeist
-  rails (~> 4.0.8)
+  rails (= 4.1.4)
   rmagick (~> 2.13.0)
   rspec-rails
-  sass-rails (~> 4.0)
-  sdoc
+  sass-rails (~> 4.0.3)
+  sdoc (~> 0.4.0)
   selenium-webdriver
   simplecov
   spank
+  spring
   sqlite3
   teaspoon
   twitter (~> 5.9.0)
Rakefile
@@ -4,4 +4,4 @@
 require File.expand_path('../config/application', __FILE__)
 require 'dotenv/tasks'
 
-Cake::Application.load_tasks
+Rails.application.load_tasks