test/test_helper.rb in destroyed_at-1.0.0 vs test/test_helper.rb in destroyed_at-1.0.1
- old
+ new
@@ -33,13 +33,23 @@
ActiveRecord::Base.connection.execute(%{CREATE TABLE categorizations (id INTEGER PRIMARY KEY, category_id INTEGER, post_id INTEGER);})
ActiveRecord::Base.connection.execute(%{CREATE TABLE comments (id INTEGER PRIMARY KEY, commenter_id INTEGER, post_id INTEGER, destroyed_at DATETIME);})
ActiveRecord::Base.connection.execute(%{CREATE TABLE commenters (id INTEGER PRIMARY KEY, destroyed_at DATETIME);})
ActiveRecord::Base.connection.execute(%{CREATE TABLE images (id INTEGER PRIMARY KEY, post_id INTEGER);})
ActiveRecord::Base.connection.execute(%{CREATE TABLE posts (id INTEGER PRIMARY KEY, author_id INTEGER, destroyed_at DATETIME);})
+ActiveRecord::Base.connection.execute(%{CREATE TABLE people (id INTEGER PRIMARY KEY);})
+ActiveRecord::Base.connection.execute(%{CREATE TABLE pets (id INTEGER PRIMARY KEY, person_id INTEGER);})
class Author < ActiveRecord::Base
has_many :posts
has_one :avatar, dependent: :destroy
+end
+
+class Person < ActiveRecord::Base
+ has_one :pet, dependent: :destroy
+end
+
+class Pet < ActiveRecord::Base
+ belongs_to :person
end
class Avatar < ActiveRecord::Base
include DestroyedAt
belongs_to :author