Commit 94a7bc75 authored by Igor Drozdov's avatar Igor Drozdov

Use User#human? instead of user_type.nil?

Rails 6.1 now returns `human` string instead of `nil`
for a human User type
parent a309f510
......@@ -17,7 +17,7 @@ class UpdateHighestRoleWorker
return unless user.present?
if user.active? && user.user_type.nil? && !user.internal?
if user.active? && user.human? && !user.internal?
Users::UpdateHighestMemberRoleService.new(user).execute
else
UserHighestRole.where(user_id: user_id).delete_all
......
......@@ -179,7 +179,7 @@ RSpec.describe Users::BuildService do
params.merge!({ user_type: :project_bot })
end
it { expect(user.project_bot?).to be true}
it { expect(user.project_bot?).to be true }
end
context 'when not a project_bot' do
......@@ -187,7 +187,7 @@ RSpec.describe Users::BuildService do
params.merge!({ user_type: :alert_bot })
end
it { expect(user.user_type).to be nil }
it { expect(user).to be_human }
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment