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

mark_as_read! for ActiveRecord::CollectionProxies #73

Open
lowjoel opened this issue Apr 8, 2016 · 7 comments
Open

mark_as_read! for ActiveRecord::CollectionProxies #73

lowjoel opened this issue Apr 8, 2016 · 7 comments

Comments

@lowjoel
Copy link
Contributor

lowjoel commented Apr 8, 2016

Currently, Model.mark_as_read!(Model.all.some_scope, for: current_user) will raise ArgumentError, since the scope is not an Array. Can it be relaxed so that any Enumerable can be used instead?

@lowjoel
Copy link
Contributor Author

lowjoel commented Apr 8, 2016

Or, maybe even better, mark_as_read! should be a scope method, then we can mark an entire scope as read. That might even be more efficient since the insertions and selects can be one single query.

@yukitoto
Copy link

Is there progress?

@GuskiS
Copy link

GuskiS commented Feb 9, 2017

Is there a plan of adding this?

@ledermann
Copy link
Owner

No plan at this moment, but I'm open for a Pull Request.

@ledermann
Copy link
Owner

Partly done by #93 - an optimized "one query" solution for scopes is still pending.

@fatkodima
Copy link
Contributor

Hey, I was implemented it here #95.

@btrd
Copy link

btrd commented Aug 14, 2019

I think this is fix in v0.10.0

mark_as_read: Any collection allowed (#93, thanks to @koriroys )

https://github.com/ledermann/unread/releases

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

No branches or pull requests

6 participants