Corrected with rubocop cop 'Lint/Loop'.
This commit is contained in:
parent
6a9aafac84
commit
f1e2a425ff
2 changed files with 5 additions and 4 deletions
|
@ -277,5 +277,3 @@ Style/ModuleFunction:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Style/AccessModifierIndentation:
|
Style/AccessModifierIndentation:
|
||||||
Enabled: false
|
Enabled: false
|
||||||
Lint/Loop:
|
|
||||||
Enabled: false
|
|
||||||
|
|
|
@ -28,8 +28,11 @@ class Token < ActiveRecord::Base
|
||||||
private
|
private
|
||||||
|
|
||||||
def generate_token
|
def generate_token
|
||||||
begin
|
|
||||||
|
loop do
|
||||||
self.name = SecureRandom.hex(20)
|
self.name = SecureRandom.hex(20)
|
||||||
end while Token.exists?( name: self.name )
|
|
||||||
|
break if !Token.exists?( name: self.name )
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue