unread
unread copied to clipboard
mark_as_read! for ActiveRecord::CollectionProxies
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?
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.
Is there progress?
Is there a plan of adding this?
No plan at this moment, but I'm open for a Pull Request.
Partly done by #93 - an optimized "one query" solution for scopes is still pending.
Hey, I was implemented it here https://github.com/ledermann/unread/pull/95.
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