title: using gem unread with public_activity
body: <p>I'm not sure this is possible, but given the way you can inject a method into modules, is there a way to inject "acts_as_readable :on => :updated_at" into PublicActivity::Activity?</p>
  
  <p>The issue is this: I want unread to also track the new activities the user has not yet seen, so I first tried it this way.</p>
  
  <pre><code>class Activity &lt; PublicActivity::Activity
    acts_as_readable :on =&gt; :updated_at
  end
  
  class User &lt; ActiveRecord::Base
    acts_as_reader
  end
  </code></pre>
  
  <p>However I noticed in the record (DB table read_marks) when I do</p>
  
  <pre><code>Activity.mark_as_read! :all, :for =&gt; current_user
  </code></pre>
  
  <p>that the readable_type key is set to 'PublicActivity::Activity' instead of 'Activity'</p>
  
  <p>This is because the Unread gem uses</p>
  
  <pre><code>user.read_marks.build(:readable_id =&gt; obj.id, :readable_type =&gt; self.base_class.name)
  </code></pre>
  
  <p>that base_class gives the class closest to ActiveRecord::Base
  What would be the best option?</p>
  
  <p>1) inject somehow the 'acts_as_readable :on => :updated_at' directly into PublicActivity::Activity</p>
  
  <p>2) fork PublicActivity and check if Unread gem is installed, if so add the line 'acts_as...'</p>
  
  <p>3) fork the Unread gem and ... not sure what I would do here, the first ugly thing that comes to mind would be to check if a class begins with PublicActivity!</p>
  
  <p>And just to define the issue: Since the record's (DB table read_marks) readable type is <strong>PublicActivity::Activity</strong> and not <strong>Activity</strong>, my </p>
  
  <pre><code>Activity.unread_by(current_user).count
  </code></pre>
  
  <p>never returns the correct count. Using </p>
  
  <pre><code>PublicActivity::Activity.unread...
  </code></pre>
  
  <p>would fail since the 'acts_as_readable :on => :updated_at' is in Activity and not PublicActivity::Activity.</p>
  
  <p>UPDATE</p>
  
  <p>I've tried to 'monkey-patch' the Public_Activity plugin but now I'm even more confused as to why it fails, it must be something dumb I'm doing. I added the following file. However the readable_type is still PublicActivity::Activity and my count remains the same after I do</p>
  
  <pre><code>PublicActivity::Activity.mark_as_read! :all, :for =&gt; current_user
  
  
  # config/initializers/activity_unread.rb
  PublicActivity::Activity.module_eval do
  
    acts_as_readable :on =&gt; :updated_at
  
  end
  </code></pre>
  
  <p>UPDATE</p>
  
  <p>AH! It was the readable_type field having a limit of only 20 that was truncating my class name. Now it works after I increased the size.</p>