ledermann / unread

Handle unread records and mark them as read with Ruby on Rails
MIT License
739 stars 121 forks source link

Added optional: true to reader's belongs_to [Fixes #120] #121

Closed k-rudy closed 4 years ago

k-rudy commented 4 years ago

Fixes the issue in Rails 6+ that has by default belongs_to_required_by_default = true setting enabled.

As a a result if any reader defines default scope and reader instance does not match that scope mark_as_read! fails with Reader must exist then

Thanks.

ledermann commented 4 years ago

Great, thanks! Would you mind adding a test to verify your change?

k-rudy commented 4 years ago

@ledermann done

ledermann commented 4 years ago

Thanks a lot, @k-rudy!