From 92661b0c501a65b7f2d9ac8fbf9743152b8a031b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Wed, 4 May 2011 16:39:01 +0200 Subject: Move sandbox to AR and pass the sandbox as a value. This way, other ORMs like Datamapper can also have their own sandboxing in rails console. --- activerecord/lib/active_record/railtie.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activerecord/lib/active_record/railtie.rb') diff --git a/activerecord/lib/active_record/railtie.rb b/activerecord/lib/active_record/railtie.rb index 276f674cc3..bae2ded244 100644 --- a/activerecord/lib/active_record/railtie.rb +++ b/activerecord/lib/active_record/railtie.rb @@ -29,7 +29,8 @@ module ActiveRecord # When loading console, force ActiveRecord::Base to be loaded # to avoid cross references when loading a constant for the # first time. Also, make it output to STDERR. - console do + console do |sandbox| + require "active_record/railties/console_sandbox" if sandbox ActiveRecord::Base.logger = Logger.new(STDERR) end -- cgit v1.2.3