You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that doing mark_ass_read! :all, for: current_user does not work, but mark_as_read! for: current_user works fine. I'm not sure if i'm doing anything wrong, but when i run it, it returns nil for some reason as well.
:all can be used only with the model classes, like Replay.mark_as_read!(:all, for: current_user). It is not currently working on relations/associations.
For your use case, currently you need to use Replay.mark_as_read!(@organization.replays, for: current_user).
I think, we can extend mark_as_read! with something like
...
if target == :all
- reset_read_marks_for_user(reader)+ if is_a?(ActiveRecord::Relation)+ mark_collection_as_read(self, reader)+ else+ reset_read_marks_for_user(reader)+ end
elsif target.respond_to?(:each)
mark_collection_as_read(target, reader)
else
...
I noticed that doing
mark_ass_read! :all, for: current_user
does not work, butmark_as_read! for: current_user
works fine. I'm not sure if i'm doing anything wrong, but when i run it, it returnsnil
for some reason as well.https://prnt.sc/v7iroq
Doesn't work
Works
The text was updated successfully, but these errors were encountered: