+__PACKAGE__->attr_sorted('attachments');
+
+sub compare_to {
+ my ($self, $other) = @_;
+
+ return -1 if $self->sent_on && !$other->sent_on;
+ return 1 if !$self->sent_on && $other->sent_on;
+
+ my $result = 0;
+ $result = $other->sent_on <=> $self->sent_on;
+ return $result || ($self->id <=> $other->id);
+}
+