Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow any collection to be marked as read #93

Merged
merged 1 commit into from
Dec 4, 2017

Conversation

koriroys
Copy link
Contributor

@koriroys koriroys commented Dec 4, 2017

My goal is to mark a collection of books as read. I don't want to mark all as read, just a select subset.

I'm attempting to use unread like so:

books = current_user.expensive_books # just some custom query that is a subset of books
Book.mark_as_read!(books, for: current_user)

It breaks with the current code as books isn't type Array. I can turn the query into an array I suppose, but I'd rather just pass the collection itself in as is. Does that seem reasonable?

@coveralls
Copy link

coveralls commented Dec 4, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling 8b207d0 on koriroys:kjr/collection-fix into 4cfe8ec on ledermann:master.

@ledermann ledermann merged commit f045f80 into ledermann:master Dec 4, 2017
@ledermann
Copy link
Owner

Great, thanks!

@koriroys
Copy link
Contributor Author

koriroys commented Dec 4, 2017

Probably should update the name of mark_array_as_read at to reflect this as well.

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.

3 participants