Commit 72f63acb by Ivan Lan

Fix assciation :pastings

parent b1560694
......@@ -4,7 +4,7 @@ module ActsAsPasting
# 带 prefix 的 pasted_with,独立于不带 prefix 的之外
included do
has_many :pastings, as: :pasted
has_many :pastings, as: :pasted, class_name: 'ActsAsPasting::Pasting'
# ary => [[klass, id], [klass, id]]
# ary => [obj, obj]
scope :pasted_with_any, ->(ary, prefix: '') {
......@@ -207,7 +207,7 @@ module ActsAsPasting
module Association
def acts_as_pasted associations, options={}
has_many :pastings, as: :pasteable
has_many :pastings, as: :pasteable, class_name: 'ActsAsPasting::Pasting'
has_many associations, through: :pastings, source: :pasted, **options
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