Sha256: 4fd5cfe6d0252724bf5377324a7893a894669a2a8ce12a232b7befa998a2450a

Contents?: true

Size: 371 Bytes

Versions: 12

Compression:

Stored size: 371 Bytes

Contents

event :validate_recaptcha_field, :validate, when: :recaptcha_setting? do
  return if content.match?(/^[a-zA-Z0-9\-_]*$/)

  errors.add :content, "invalid key" # LOCALIZE
end

event :set_recaptcha_site_key, :finalize, when: :recaptcha_setting? do
  Card.config.send "recaptcha_#{codename}=", content
end

def recaptcha_setting?
  left&.codename == :recaptcha_settings
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
card-mod-recaptcha-0.18.1 set/abstract/recaptcha_setting.rb
card-mod-recaptcha-0.18.0 set/abstract/recaptcha_setting.rb
card-mod-recaptcha-0.17.0 set/abstract/recaptcha_setting.rb
card-mod-recaptcha-0.16.0 set/abstract/recaptcha_setting.rb
card-mod-recaptcha-0.15.6 set/abstract/recaptcha_setting.rb
card-mod-recaptcha-0.15.5 set/abstract/recaptcha_setting.rb
card-mod-recaptcha-0.15.4 set/abstract/recaptcha_setting.rb
card-mod-recaptcha-0.15.3 set/abstract/recaptcha_setting.rb
card-mod-recaptcha-0.15.2.pre1 set/abstract/recaptcha_setting.rb
card-mod-recaptcha-0.15.1.1 set/abstract/recaptcha_setting.rb
card-mod-recaptcha-0.15.1 set/abstract/recaptcha_setting.rb
card-mod-recaptcha-0.15.0 set/abstract/recaptcha_setting.rb