Fix failing spec due to missing variable in extracted method

This commit is contained in:
Rafael George 2013-10-04 12:18:07 -04:00
parent 26c090439d
commit 622ffddbb8

View File

@ -426,7 +426,7 @@ class Topic < ActiveRecord::Base
invite = Invite.create(invited_by: invited_by, email: lower_email) invite = Invite.create(invited_by: invited_by, email: lower_email)
unless invite.valid? unless invite.valid?
grant_permission_to_user if email_already_exists_for?(invite) grant_permission_to_user(lower_email) if email_already_exists_for?(invite)
return return
end end
@ -444,8 +444,8 @@ class Topic < ActiveRecord::Base
invite.email_already_exists and private_message? invite.email_already_exists and private_message?
end end
def grant_permission_to_user def grant_permission_to_user(lower_email)
User.where(email: lower_email).first user = User.where(email: lower_email).first
topic_allowed_users.create!(user_id: user.id) topic_allowed_users.create!(user_id: user.id)
end end