Skip to content

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

Merged
ledermann merged 2 commits into
ledermann:masterfrom
Profinda:master
Oct 31, 2020
Merged

Added optional: true to reader's belongs_to [Fixes #120]#121
ledermann merged 2 commits into
ledermann:masterfrom
Profinda:master

Conversation

@k-rudy

@k-rudy k-rudy commented Oct 29, 2020

Copy link
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Owner

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

@k-rudy k-rudy changed the title Added optional: true to read_marks [Fixes #120] Added optional: true to reader's belongs_to [Fixes #120] Oct 30, 2020
@k-rudy

k-rudy commented Oct 30, 2020

Copy link
Copy Markdown
Contributor Author

@ledermann done

@ledermann ledermann merged commit 0f1b242 into ledermann:master Oct 31, 2020
@ledermann

ledermann commented Oct 31, 2020

Copy link
Copy Markdown
Owner

Thanks a lot, @k-rudy!

HwakyoungLee pushed a commit to grepp/unread that referenced this pull request May 12, 2023
…dermann#121)

* Added optional: true to read_marks [Fixes ledermann#120]
* Added specs for the optional reader case [Fixes ledermann#120]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants