Module: ReallySimpleCaptcha::Captcha::PlainCaptcha::ControllerHelpers

Defined in:
lib/really_simple_captcha/captcha/plain_captcha.rb

Instance Method Summary collapse

Instance Method Details

#plain_captcha_valid?Boolean

Returns:

  • (Boolean)


55
56
57
58
59
60
61
62
# File 'lib/really_simple_captcha/captcha/plain_captcha.rb', line 55

def plain_captcha_valid?
  return true if Rails.env.test?

  res = params[PlainCaptcha.field_name] == session[PlainCaptcha.field_name]
  session[PlainCaptcha.field_name] = nil

  res
end