aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/examples/shared_setup.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2004-11-24 01:04:44 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2004-11-24 01:04:44 +0000
commitdb045dbbf60b53dbe013ef25554fd013baf88134 (patch)
tree257830e3c76458c8ff3d1329de83f32b23926028 /activerecord/examples/shared_setup.rb
downloadrails-db045dbbf60b53dbe013ef25554fd013baf88134.tar.gz
rails-db045dbbf60b53dbe013ef25554fd013baf88134.tar.bz2
rails-db045dbbf60b53dbe013ef25554fd013baf88134.zip
Initial
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/examples/shared_setup.rb')
-rw-r--r--activerecord/examples/shared_setup.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/examples/shared_setup.rb b/activerecord/examples/shared_setup.rb
new file mode 100644
index 0000000000..6ede4b1d35
--- /dev/null
+++ b/activerecord/examples/shared_setup.rb
@@ -0,0 +1,15 @@
+# Be sure to change the mysql_connection details and create a database for the example
+
+$: << File.dirname(__FILE__) + '/../lib'
+
+require 'active_record'
+require 'logger'; class Logger; def format_message(severity, timestamp, msg, progname) "#{msg}\n" end; end
+
+ActiveRecord::Base.logger = Logger.new(STDOUT)
+ActiveRecord::Base.establish_connection(
+ :adapter => "mysql",
+ :host => "localhost",
+ :username => "root",
+ :password => "",
+ :database => "activerecord_examples"
+)