lml / commontator

A Rails engine for comments
MIT License
354 stars 99 forks source link

does not work with active storage attachment #196

Open lethunder opened 2 years ago

lethunder commented 2 years ago

when adding acts_as_commontable to active storage attachment, commontator raise an error when adding picture to user for instance with

<ArgumentError: wrong number of arguments (given 3, expected 0)>

it happens at in lib/commontator/acts_as_commontable.rb line 27 validates :commontator_thread, presence: true, if: -> { Commontator::Thread.table_exists? }

i needed to add this unless self.name == "ActiveStorage::Attachment" validates :commontator_thread, presence: true, if: -> { Commontator::Thread.table_exists? } end

to make it work