Skip to content

does not work with active storage attachment #196

Description

@lethunder

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions