Permalink
Browse files

Less zealous on detecting duplicate messages.

  • Loading branch information...
1 parent f259ba0 commit 057c590f6129063bd17ca87fb6c746f0eb6beaf1 @seven1m seven1m committed Jul 10, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 app/models/message.rb
View
2 app/models/message.rb
@@ -78,7 +78,7 @@ def remove_message_id_in_body
end
validate :on => :create do |record|
- if Message.find_by_person_id_and_subject_and_body(record.person_id, record.subject, record.body, :conditions => ['created_at >= ?', Date.today-1])
+ if Message.find_by_person_id_and_subject_and_body_and_to_person_id(record.person_id, record.subject, record.body, record.to_person_id, :conditions => ['created_at >= ?', Date.today-1])
record.errors.add :base, 'already saved' # Notifier relies on this message (don't change it)
end
if record.subject =~ /Out of Office/i

0 comments on commit 057c590

Please sign in to comment.