Corrected with rubocop cop 'Lint/Loop'.

This commit is contained in:
Thorsten Eckel 2015-05-05 12:32:25 +02:00
parent 6a9aafac84
commit f1e2a425ff
2 changed files with 5 additions and 4 deletions

View file

@ -277,5 +277,3 @@ Style/ModuleFunction:
Enabled: false
Style/AccessModifierIndentation:
Enabled: false
Lint/Loop:
Enabled: false

View file

@ -28,8 +28,11 @@ class Token < ActiveRecord::Base
private
def generate_token
begin
loop do
self.name = SecureRandom.hex(20)
end while Token.exists?( name: self.name )
break if !Token.exists?( name: self.name )
end
end
end