Skip to content

Commit

Permalink
Maintain Rails 3 compatibility in #reset_read_marks_for_user
Browse files Browse the repository at this point in the history
  • Loading branch information
bcavileer committed Mar 28, 2016
1 parent 689f9fd commit 86311ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/unread/readable.rb
Expand Up @@ -57,7 +57,7 @@ def readable_parent
end
current_klass
end

def cleanup_read_marks!
assert_reader_class
Unread::GarbageCollector.new(self).run!
Expand All @@ -68,7 +68,10 @@ def reset_read_marks_for_user(reader)

ReadMark.transaction do
reader.read_marks.where(:readable_type => self.readable_parent.name).delete_all
reader.read_marks.create! :readable_type => self.readable_parent.name, :timestamp => Time.current
rm = reader.read_marks.new
rm.readable_type = self.readable_parent.name
rm.timestamp = Time.current
rm.save!
end

reader.forget_memoized_read_mark_global
Expand Down

0 comments on commit 86311ae

Please sign in to comment.