Commit 896f6f72 by Ivan Lan

Add pasting type logic

parent 6402d2ab
...@@ -4,7 +4,6 @@ class CreateActsAsPastingPastings < ActiveRecord::Migration[5.2] ...@@ -4,7 +4,6 @@ class CreateActsAsPastingPastings < ActiveRecord::Migration[5.2]
t.references :pasteable, polymorphic: true, index: { name: 'acts_as_pasting_pasteable' } t.references :pasteable, polymorphic: true, index: { name: 'acts_as_pasting_pasteable' }
t.references :pasted, polymorphic: true, index: { name: 'acts_as_pasting_pasted' } t.references :pasted, polymorphic: true, index: { name: 'acts_as_pasting_pasted' }
t.string :type, index: true t.string :type, index: true
t.string :pasting_type
t.timestamps t.timestamps
end end
......
...@@ -20,6 +20,8 @@ ...@@ -20,6 +20,8 @@
# #
module ActsAsPasting module ActsAsPasting
class Pasting < ApplicationRecord class Pasting < ApplicationRecord
self.inheritance_column = :_type_disabled
belongs_to :pasteable, polymorphic: true belongs_to :pasteable, polymorphic: true
belongs_to :pasted, polymorphic: true belongs_to :pasted, polymorphic: true
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment