From 2c4ec96acaaf820e2c662495da6c04a2a89737bc Mon Sep 17 00:00:00 2001 From: Konstantin Rudy Date: Thu, 29 Oct 2020 18:09:19 +0300 Subject: [PATCH] Added optional: true to read_marks [Fixes #120] --- lib/unread/read_mark.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/unread/read_mark.rb b/lib/unread/read_mark.rb index da3fbfe..9e17214 100644 --- a/lib/unread/read_mark.rb +++ b/lib/unread/read_mark.rb @@ -1,5 +1,5 @@ class ReadMark < ActiveRecord::Base - belongs_to :readable, polymorphic: true, inverse_of: :read_marks + belongs_to :readable, polymorphic: true, inverse_of: :read_marks, optional: true validates_presence_of :reader_id, :reader_type, :readable_type