Commit ed5481d8 by Ivan Lan

Change args order

parent d104ce11
...@@ -32,7 +32,7 @@ module ActsAsPasting ...@@ -32,7 +32,7 @@ module ActsAsPasting
end end
module ClassMethods module ClassMethods
def acts_as_pastable associations, options={}, prefix: '' def acts_as_pastable associations, prefix: '', **options
pasting_name = prefix.blank? ? :pastings : [prefix, 'pastings'].join('_').to_sym pasting_name = prefix.blank? ? :pastings : [prefix, 'pastings'].join('_').to_sym
has_many pasting_name, as: :pasteable, class_name: 'ActsAsPasting::Pasting' has_many pasting_name, as: :pasteable, class_name: 'ActsAsPasting::Pasting'
has_many associations, through: pasting_name, source: :pasted, **options has_many associations, through: pasting_name, source: :pasted, **options
......
...@@ -201,7 +201,7 @@ module ActsAsPasting ...@@ -201,7 +201,7 @@ module ActsAsPasting
end end
end end
def acts_as_pasted associations, options={}, prefix: '' def acts_as_pasted associations, prefix: '', **options
pasting_name = prefix.blank? ? :pastings : [prefix, 'pastings'].join('_').to_sym pasting_name = prefix.blank? ? :pastings : [prefix, 'pastings'].join('_').to_sym
has_many pasting_name, -> { where(type: prefix) }, class_name: 'ActsAsPasting::Pasting', as: :pasted has_many pasting_name, -> { where(type: prefix) }, class_name: 'ActsAsPasting::Pasting', as: :pasted
has_many associations, through: pasting_name, source: :pasteable, **options has_many associations, through: pasting_name, source: :pasteable, **options
......
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