Module: CustomCaptcha::ActiveRecordExtension::ClassMethods

Defined in:
lib/custom_captcha/active_record_extension.rb

Instance Method Summary collapse

Instance Method Details

#apply_custom_captchaObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/custom_captcha/active_record_extension.rb', line 9

def apply_custom_captcha
  attr_accessor :custom_captcha, :custom_captcha_key

  after_initialize do
    after_initialize if custom_captcha_need_valid?
  end

  validate :valid_custom_captcha, :if => :custom_captcha_need_valid?

  include CustomCaptcha::ActiveRecordExtension::InstanceMethods
end