My application has news, posts, comments and various other common things. I'd like to be able to keep track of what a user has viewed so that they can be greeted with "4 new Posts" and that type of thing.
At the moment I'm just reporting the number of 'New Posts' with something like:
Post.find(:all, :conditions => [ "updated_at > ?", session[:user_last_login]]).length
Obviously that's only partly as good.
Before I go making a mess of my whole application, is there what's the simplest way I can achieve what I've described, and does rails have any bits to help me out?
Also, is there a common name for this kind of functionality which might aid my googling?
Thanks.