Skip to content

Commit

Permalink
Setup to use 3.2 automatic EXPLAIN
Browse files Browse the repository at this point in the history
  • Loading branch information
jcasimir committed Feb 3, 2012
1 parent b4e3664 commit d9091d7
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 35 deletions.
2 changes: 1 addition & 1 deletion Gemfile
@@ -1,6 +1,6 @@
source 'http://rubygems.org' source 'http://rubygems.org'


gem 'rails', '3.2.0' gem 'rails', '3.2.1'
gem 'sqlite3' gem 'sqlite3'
gem 'jquery-rails' gem 'jquery-rails'


Expand Down
66 changes: 33 additions & 33 deletions Gemfile.lock
@@ -1,31 +1,31 @@
GEM GEM
remote: http://rubygems.org/ remote: http://rubygems.org/
specs: specs:
actionmailer (3.2.0) actionmailer (3.2.1)
actionpack (= 3.2.0) actionpack (= 3.2.1)
mail (~> 2.4.0) mail (~> 2.4.0)
actionpack (3.2.0) actionpack (3.2.1)
activemodel (= 3.2.0) activemodel (= 3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
builder (~> 3.0.0) builder (~> 3.0.0)
erubis (~> 2.7.0) erubis (~> 2.7.0)
journey (~> 1.0.0) journey (~> 1.0.1)
rack (~> 1.4.0) rack (~> 1.4.0)
rack-cache (~> 1.1) rack-cache (~> 1.1)
rack-test (~> 0.6.1) rack-test (~> 0.6.1)
sprockets (~> 2.1.2) sprockets (~> 2.1.2)
activemodel (3.2.0) activemodel (3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
builder (~> 3.0.0) builder (~> 3.0.0)
activerecord (3.2.0) activerecord (3.2.1)
activemodel (= 3.2.0) activemodel (= 3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
arel (~> 3.0.0) arel (~> 3.0.0)
tzinfo (~> 0.3.29) tzinfo (~> 0.3.29)
activeresource (3.2.0) activeresource (3.2.1)
activemodel (= 3.2.0) activemodel (= 3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
activesupport (3.2.0) activesupport (3.2.1)
i18n (~> 0.6) i18n (~> 0.6)
multi_json (~> 1.0) multi_json (~> 1.0)
addressable (2.2.6) addressable (2.2.6)
Expand All @@ -40,9 +40,9 @@ GEM
xpath (~> 0.1.4) xpath (~> 0.1.4)
childprocess (0.3.0) childprocess (0.3.0)
ffi (~> 1.0.6) ffi (~> 1.0.6)
coffee-rails (3.2.1) coffee-rails (3.2.2)
coffee-script (>= 2.2.0) coffee-script (>= 2.2.0)
railties (~> 3.2.0.beta) railties (~> 3.2.0)
coffee-script (2.2.0) coffee-script (2.2.0)
coffee-script-source coffee-script-source
execjs execjs
Expand All @@ -63,7 +63,7 @@ GEM
guard (>= 0.10.0) guard (>= 0.10.0)
hike (1.2.1) hike (1.2.1)
i18n (0.6.0) i18n (0.6.0)
journey (1.0.0) journey (1.0.1)
jquery-rails (2.0.0) jquery-rails (2.0.0)
railties (>= 3.2.0.beta, < 5.0) railties (>= 3.2.0.beta, < 5.0)
thor (~> 0.14) thor (~> 0.14)
Expand All @@ -85,17 +85,17 @@ GEM
rack rack
rack-test (0.6.1) rack-test (0.6.1)
rack (>= 1.0) rack (>= 1.0)
rails (3.2.0) rails (3.2.1)
actionmailer (= 3.2.0) actionmailer (= 3.2.1)
actionpack (= 3.2.0) actionpack (= 3.2.1)
activerecord (= 3.2.0) activerecord (= 3.2.1)
activeresource (= 3.2.0) activeresource (= 3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
bundler (~> 1.0) bundler (~> 1.0)
railties (= 3.2.0) railties (= 3.2.1)
railties (3.2.0) railties (3.2.1)
actionpack (= 3.2.0) actionpack (= 3.2.1)
activesupport (= 3.2.0) activesupport (= 3.2.1)
rack-ssl (~> 1.3.2) rack-ssl (~> 1.3.2)
rake (>= 0.8.7) rake (>= 0.8.7)
rdoc (~> 3.4) rdoc (~> 3.4)
Expand All @@ -118,11 +118,11 @@ GEM
rspec (~> 2.8.0) rspec (~> 2.8.0)
rubyzip (0.9.5) rubyzip (0.9.5)
sass (3.1.12) sass (3.1.12)
sass-rails (3.2.3) sass-rails (3.2.4)
railties (~> 3.2.0.beta) railties (~> 3.2.0)
sass (>= 3.1.10) sass (>= 3.1.10)
tilt (~> 1.3) tilt (~> 1.3)
selenium-webdriver (2.17.0) selenium-webdriver (2.18.0)
childprocess (>= 0.2.5) childprocess (>= 0.2.5)
ffi (~> 1.0.9) ffi (~> 1.0.9)
multi_json (~> 1.0.4) multi_json (~> 1.0.4)
Expand All @@ -138,7 +138,7 @@ GEM
polyglot polyglot
polyglot (>= 0.3.1) polyglot (>= 0.3.1)
tzinfo (0.3.31) tzinfo (0.3.31)
uglifier (1.2.2) uglifier (1.2.3)
execjs (>= 0.3.0) execjs (>= 0.3.0)
multi_json (>= 1.0.2) multi_json (>= 1.0.2)
xpath (0.1.4) xpath (0.1.4)
Expand All @@ -157,7 +157,7 @@ DEPENDENCIES
guard-rspec guard-rspec
jquery-rails jquery-rails
launchy launchy
rails (= 3.2.0) rails (= 3.2.1)
rspec-rails rspec-rails
sass-rails sass-rails
sqlite3 sqlite3
Expand Down
2 changes: 1 addition & 1 deletion app/models/article.rb
Expand Up @@ -15,7 +15,7 @@ def tag_list
end end


def self.most_popular def self.most_popular
Article.all.sort_by{|a| a.comments.count}.last Article.all.sort_by{|a| a.comments.size}.last
end end


def tag_list=(input) def tag_list=(input)
Expand Down
2 changes: 2 additions & 0 deletions config/environments/development.rb
Expand Up @@ -27,4 +27,6 @@


# Expands the lines which load the assets # Expands the lines which load the assets
config.assets.debug = true config.assets.debug = true

config.active_record.auto_explain_threshold_in_seconds = 0.2
end end
11 changes: 11 additions & 0 deletions config/initializers/quiet_assets.rb
@@ -0,0 +1,11 @@
Rails.application.assets.logger = Logger.new('/dev/null')
Rails::Rack::Logger.class_eval do
def call_with_quiet_assets(env)
previous_level = Rails.logger.level
Rails.logger.level = Logger::ERROR if env['PATH_INFO'].index("/assets/") == 0
call_without_quiet_assets(env).tap do
Rails.logger.level = previous_level
end
end
alias_method_chain :call, :quiet_assets
end

0 comments on commit d9091d7

Please sign in to comment.