diff --git a/test/dummy/app/models/post.rb b/test/dummy/app/models/post.rb new file mode 100644 index 00000000..9892fd80 --- /dev/null +++ b/test/dummy/app/models/post.rb @@ -0,0 +1,4 @@ +class Post < ActiveRecord::Base + has_paper_trail :class_name => "PostVersion" + +end diff --git a/test/dummy/app/versions/post_version.rb b/test/dummy/app/versions/post_version.rb new file mode 100644 index 00000000..ae59ccb4 --- /dev/null +++ b/test/dummy/app/versions/post_version.rb @@ -0,0 +1,3 @@ +class PostVersion < Version + set_table_name :post_versions +end \ No newline at end of file diff --git a/test/dummy/db/development.sqlite3 b/test/dummy/db/development.sqlite3 index b46741d6..8c115963 100644 Binary files a/test/dummy/db/development.sqlite3 and b/test/dummy/db/development.sqlite3 differ diff --git a/test/dummy/db/migrate/20110208155312_set_up_test_tables.rb b/test/dummy/db/migrate/20110208155312_set_up_test_tables.rb index 412cf8af..5ce7dab7 100644 --- a/test/dummy/db/migrate/20110208155312_set_up_test_tables.rb +++ b/test/dummy/db/migrate/20110208155312_set_up_test_tables.rb @@ -34,6 +34,20 @@ class SetUpTestTables < ActiveRecord::Migration t.string :user_agent end add_index :versions, [:item_type, :item_id] + + create_table :post_versions, :force => true do |t| + t.string :item_type, :null => false + t.integer :item_id, :null => false + t.string :event, :null => false + t.string :whodunnit + t.text :object + t.datetime :created_at + + # Controller info columns. + t.string :ip + t.string :user_agent + end + add_index :post_versions, [:item_type, :item_id] create_table :wotsits, :force => true do |t| t.integer :widget_id @@ -68,9 +82,15 @@ class SetUpTestTables < ActiveRecord::Migration create_table :songs, :force => true do |t| t.integer :length end + + create_table :posts, :force => true do |t| + t.string :title + t.string :content + end end def self.down + drop_table :posts drop_table :songs drop_table :people drop_table :authorships @@ -78,6 +98,8 @@ class SetUpTestTables < ActiveRecord::Migration drop_table :articles drop_table :fluxors drop_table :wotsits + remove_index :post_versions, :column => [:item_type, :item_id] + drop_table :post_versions remove_index :versions, :column => [:item_type, :item_id] drop_table :versions drop_table :widgets diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb index 35d5889e..e6fde32a 100644 --- a/test/dummy/db/schema.rb +++ b/test/dummy/db/schema.rb @@ -36,6 +36,24 @@ ActiveRecord::Schema.define(:version => 20110208155312) do t.string "name" end + create_table "post_versions", :force => true do |t| + t.string "item_type", :null => false + t.integer "item_id", :null => false + t.string "event", :null => false + t.string "whodunnit" + t.text "object" + t.datetime "created_at" + t.string "ip" + t.string "user_agent" + end + + add_index "post_versions", ["item_type", "item_id"], :name => "index_post_versions_on_item_type_and_item_id" + + create_table "posts", :force => true do |t| + t.string "title" + t.string "content" + end + create_table "songs", :force => true do |t| t.integer "length" end diff --git a/test/dummy/db/test.sqlite3 b/test/dummy/db/test.sqlite3 index 28854326..b862ed66 100644 Binary files a/test/dummy/db/test.sqlite3 and b/test/dummy/db/test.sqlite3 differ