aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2011-03-31 14:33:24 -0700
committerDavid Heinemeier Hansson <david@loudthinking.com>2011-03-31 14:33:24 -0700
commitcaf0a72c85ddd30f901c33a2d72cf2a7453ed469 (patch)
tree23091c17450ae640b3b8373d326abbba912ed461 /railties
parent6eff04499e28865890e1ae3915fe80e4903a997b (diff)
downloadrails-caf0a72c85ddd30f901c33a2d72cf2a7453ed469.tar.gz
rails-caf0a72c85ddd30f901c33a2d72cf2a7453ed469.tar.bz2
rails-caf0a72c85ddd30f901c33a2d72cf2a7453ed469.zip
Direct logging of Active Record to STDOUT so it's shown inline with the results in the console [DHH]
Diffstat (limited to 'railties')
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/rails/commands/console.rb4
2 files changed, 6 insertions, 0 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index c1e0a214d2..07e7e461de 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*Rails 3.1.0 (unreleased)*
+* Direct logging of Active Record to STDOUT so it's shown inline with the results in the console [DHH]
+
* Added `config.force_ssl` configuration which loads Rack::SSL middleware and force all requests to be under HTTPS protocol [DHH, Prem Sichanugrist, and Josh Peek]
* Added `rails plugin new` command which generates rails plugin with gemspec, tests and dummy application for testing [Piotr Sarnacki]
diff --git a/railties/lib/rails/commands/console.rb b/railties/lib/rails/commands/console.rb
index de2f190ad5..2a6cdca440 100644
--- a/railties/lib/rails/commands/console.rb
+++ b/railties/lib/rails/commands/console.rb
@@ -34,6 +34,10 @@ module Rails
exit
end
end
+
+ if defined?(ActiveRecord)
+ ActiveRecord::Base.logger = Logger.new(STDOUT)
+ end
if options[:sandbox]
puts "Loading #{Rails.env} environment in sandbox (Rails #{Rails.version})"