mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 00:35:31 +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)
|
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
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user