prefer each over for

This commit is contained in:
Georg Kahest 2017-11-14 12:51:44 +02:00
parent e62bb19a7e
commit abeeec3baf
2 changed files with 7 additions and 8 deletions

View file

@ -58,12 +58,11 @@ class ApiUser < User
return false if ip.blank?
possible_users = where(identity_code: identity_code)
for selected_user in 0..possible_users.count
if possible_users[selected_user].registrar.white_ips.registrar_area.include_ip?(ip)
break
possible_users eacho do |selected_user|
if selected_user.registrar.white_ips.registrar_area.include_ip?(ip)
return selected_user
end
end
possible_users[selected_user]
end
end