I'm not sure if this is possible, but given how you can introduce a method into modules, is there a way to insert "act_as_readable: on =>: update_at" in PublicActivity :: Activity?
The problem is this: I want the unread ones to also keep track of new actions that the user has not yet seen, so I first tried this this way.
class Activity < PublicActivity::Activity
acts_as_readable :on => :updated_at
end
class User < ActiveRecord::Base
acts_as_reader
end
However, I noticed in the record (DB table read tables) when I do
Activity.mark_as_read! :all, :for => current_user
that the readable_type key is set to "PublicActivity :: Activity" instead of "Activity"
This is because Unread Gem uses
user.read_marks.build(:readable_id => obj.id, :readable_type => self.base_class.name)
what base_class gives the class closest to ActiveRecord :: Base What would be the best option?
1) - "act_as_readable: on = > : updated_at" PublicActivity:: Activity
2) fork PublicActivity , gem, "act_as..."
3) ... , , , , - , PublicActivity!
: (DB table read_marks) PublicActivity:: Activity, Activity,
Activity.unread_by(current_user).count
.
PublicActivity::Activity.unread...
, "act_as_readable: on = > : updated_at" Activity, PublicActivity:: Activity.
Public_Activity "monkey-patch", , , - , . . readable_type - PublicActivity:: Activity, ,
PublicActivity::Activity.mark_as_read! :all, :for => current_user
PublicActivity::Activity.module_eval do
acts_as_readable :on => :updated_at
end
! readable_type 20, . , .