Commit da399723 by Ivan Lan

Pastable has_many

parent 9203ca42
......@@ -4,8 +4,8 @@ module ActsAsPasting
# 带 prefix 的 pasted_with,独立于不带 prefix 的之外
included do
has_many :pastings, as: :pasteable, class_name: 'ActsAsPasting::Pasting'
has_many :hosts, through: :pastings
has_many :pastable_pastings, as: :pasteable, class_name: 'ActsAsPasting::Pasting'
has_many :hosts, through: :pastable_pastings
# ary => [[klass, id], [klass, id]]
# ary => [obj, obj]
......
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