I used papertrail gem
for this type of tasks, but this should work the same for you.
An idea would be to update the post of the comment, when comment will be created - save will be called on it's post and will create a new version of this post. Something like this:
class Comment < ActiveRecord::Base
belongs_to :post
after_create :update_post
def update_post
self.post.save
end
end
again, probably not the best way as you have to call save on post each time you add a comment and this is a performance issue.
update based on kwirschau
comment
def update_post
self.post.send(:create_version)
end