Makes has_messages compatible with Rails 4