spec/db/schema.rb in goldiloader-0.0.7 vs spec/db/schema.rb in goldiloader-0.0.8
- old
+ new
@@ -8,10 +8,12 @@
create_table(:posts, force: true) do |t|
t.string :title
t.integer :blog_id
t.integer :author_id
+ t.string :owner_type
+ t.integer :owner_id
end
create_table(:users, force: true) do |t|
t.string :name
end
@@ -103,9 +105,11 @@
belongs_to :blog
belongs_to :blog_without_auto_include, auto_include: false, class_name: 'Blog', foreign_key: :blog_id
belongs_to :author, class_name: 'User'
has_many :post_tags
has_many :tags, through: :post_tags
+
+ belongs_to :owner, polymorphic: true
if ActiveRecord::VERSION::MAJOR >= 4
has_many :unique_tags, -> { distinct }, through: :post_tags, source: :tag, class_name: 'Tag'
else
has_many :unique_tags, through: :post_tags, source: :tag, uniq: true, class_name: 'Tag'