aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/examples
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2009-05-13 11:55:19 -0700
committerJeremy Kemper <jeremy@bitsweat.net>2009-05-13 12:00:49 -0700
commit4f291fa528e5faad03def69ae7ac98224ab859db (patch)
tree3a9bc62fd9bfb6913b5899f6b86c953d4aa78c1d /activerecord/examples
parente8550ee0329586b32de425e905c7af7e65bc78a8 (diff)
downloadrails-4f291fa528e5faad03def69ae7ac98224ab859db.tar.gz
rails-4f291fa528e5faad03def69ae7ac98224ab859db.tar.bz2
rails-4f291fa528e5faad03def69ae7ac98224ab859db.zip
Simple examples for require profiling
Diffstat (limited to 'activerecord/examples')
-rw-r--r--activerecord/examples/simple.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/examples/simple.rb b/activerecord/examples/simple.rb
new file mode 100644
index 0000000000..c12f746992
--- /dev/null
+++ b/activerecord/examples/simple.rb
@@ -0,0 +1,14 @@
+$LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib"
+require 'active_record'
+
+class Person < ActiveRecord::Base
+ establish_connection :adapter => 'sqlite3', :database => 'foobar.db'
+ connection.create_table table_name, :force => true do |t|
+ t.string :name
+ end
+end
+
+bob = Person.create!(:name => 'bob')
+puts Person.all.inspect
+bob.destroy
+puts Person.all.inspect