Simplified range check
This commit is contained in:
parent
f53001577e
commit
1de67281f4
1 changed files with 1 additions and 6 deletions
|
|
@ -1,11 +1,6 @@
|
|||
SimpleCaptcha.setup do |sc|
|
||||
sc.image_size = AppConfig.settings.captcha.image_size
|
||||
value_length = AppConfig.settings.captcha.captcha_length.to_i
|
||||
if value_length <= 12 && value_length > 0
|
||||
sc.length = value_length
|
||||
else
|
||||
sc.length = 5
|
||||
end
|
||||
sc.length = [1, [AppConfig.settings.captcha_length.to_i, 12].min].max
|
||||
sc.image_style = AppConfig.settings.captcha.image_style
|
||||
sc.distortion = AppConfig.settings.captcha.distortion
|
||||
p AppConfig.settings.captcha
|
||||
|
|
|
|||
Loading…
Reference in a new issue