mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 15:16:04 +08:00
Fix failing spec due to missing variable in extracted method
This commit is contained in:
parent
26c090439d
commit
622ffddbb8
|
@ -426,7 +426,7 @@ class Topic < ActiveRecord::Base
|
|||
invite = Invite.create(invited_by: invited_by, email: lower_email)
|
||||
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
|
||||
end
|
||||
|
@ -444,8 +444,8 @@ class Topic < ActiveRecord::Base
|
|||
invite.email_already_exists and private_message?
|
||||
end
|
||||
|
||||
def grant_permission_to_user
|
||||
User.where(email: lower_email).first
|
||||
def grant_permission_to_user(lower_email)
|
||||
user = User.where(email: lower_email).first
|
||||
topic_allowed_users.create!(user_id: user.id)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user