diff --git a/app/models/user.rb b/app/models/user.rb index a26f6e6d9..1e764f2a0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -227,14 +227,6 @@ class User < ActiveRecord::Base where(conditions).first end - # @param [Person] person - # @return [Boolean] whether this user can add person as a contact. - def can_add?(person) - return false if self.person == person - return false if self.contact_for(person).present? - true - end - def confirm_email(token) return false if token.blank? || token != confirm_email_token self.email = unconfirmed_email diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 905ec7295..f167d441d 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -407,28 +407,6 @@ describe User do end end - describe "#can_add?" do - it "returns true if there is no existing connection" do - alice.can_add?(eve.person).should be_true - end - - it "returns false if the user and the person are the same" do - alice.can_add?(alice.person).should be_false - end - - it "returns false if the users are already connected" do - alice.can_add?(bob.person).should be_false - end - - it "returns false if the user has already sent a request to that person" do - alice.share_with(eve.person, alice.aspects.first) - alice.reload - eve.reload - alice.can_add?(eve.person).should be_false - end - end - - describe '#process_invite_acceptence' do it 'sets the inviter on user' do inv = InvitationCode.create(:user => bob)