Module: ActsAsTextcaptcha::Textcaptcha::InstanceMethods

Defined in:
lib/acts_as_textcaptcha/textcaptcha.rb

Instance Method Summary collapse

Instance Method Details

#perform_textcaptcha?Boolean

override this method to toggle textcaptcha checking, by default this will only allow new records to be protected with textcaptchas

Returns:

  • (Boolean)


28
29
30
# File 'lib/acts_as_textcaptcha/textcaptcha.rb', line 28

def perform_textcaptcha?
  (!respond_to?("new_record?") || new_record?)
end

#textcaptchaObject



32
33
34
# File 'lib/acts_as_textcaptcha/textcaptcha.rb', line 32

def textcaptcha
  assign_textcaptcha(fetch_q_and_a || config_q_and_a) if perform_textcaptcha? && textcaptcha_config
end