From c5f2e8bb2d90cb0ba0bfb258cb6786c303193de6 Mon Sep 17 00:00:00 2001 From: maxwell Date: Fri, 3 Dec 2010 22:58:37 -0800 Subject: [PATCH] now you can not invite yourself. we have a bug as send_contact_request_to was taken out but Invitation still used it --- app/models/invitation.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/models/invitation.rb b/app/models/invitation.rb index 88174d081..bfdcb0dcb 100644 --- a/app/models/invitation.rb +++ b/app/models/invitation.rb @@ -13,6 +13,7 @@ class Invitation validates_presence_of :from, :to, :into def self.invite(opts = {}) + return false if opts[:email] == opts[:from].email existing_user = User.find_by_email(opts[:email]) if existing_user if opts[:from].contact_for(opts[:from].person)