Skip to content

mark_as_read! fails with exception on Rails 6+ if Reader has default_scope defined #120

@k-rudy

Description

@k-rudy

Hey guys,

We're having the following issue:
If the reader has default_scope defined, running mark_as_read! on readable will raise an exception:

ActiveRecord::RecordInvalid: Validation failed: Reader must exist

This is happening as belongs_to definition of the ReadMark needs to specify optional: true while it doesn't.

Thank you,
Kon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions