recaptcha 1.2.0 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a5d30f6746c9696342ee57a9a6e5b68d6533c872
4
- data.tar.gz: 43d5007e1ac5009c59df1ca855dad57aa0bc3ffd
3
+ metadata.gz: e3c89ffab2c2bcfb9e2310157d81cca7a6310eb7
4
+ data.tar.gz: 12e9212f8ec32eb1f67470fc0a0644a8570b1dae
5
5
  SHA512:
6
- metadata.gz: ba45310973de3e78f50382bfee7f987e3b8dba69d5fe63c0f0ecbf99e53faf5e5598b2c1b528c2c724d2fa5d3c1161b3744b3c0bd13408a1f832d6976db342f5
7
- data.tar.gz: 406628e86ba2dc2d4c3e13159d2d0f11f51965a3a4c1f5b519e50d1790dcb363ddac77d2fa3b749a1804d66bfd72af92f93713b57f7fdb18e5d8cfc1f82d08ff
6
+ metadata.gz: 354b302b4061839590ac00b6c599c9d7317c1f8221e0ac3ef38ec514d52e459d0ecabbb347aaf1930a7e0aff8957e9835f122e8c73d8a7aba8763ddb6715a6d7
7
+ data.tar.gz: b1045a9e879f6267ba59a44e738c89bbaac29c5f52fa68b8421dc68ec0fc782dfdf2557d63b10cefc9bb013f44f9d3826fcdf292128055e12c20e9daad3fb397
@@ -28,7 +28,7 @@ module Recaptcha
28
28
  answer = reply['success']
29
29
 
30
30
  if hostname_valid?(reply['hostname'], options[:hostname]) && answer.to_s == 'true'
31
- flash.delete(:recaptcha_error) if recaptcha_flash_supported?
31
+ flash.delete(:recaptcha_error) if recaptcha_flash_supported? && !model
32
32
  true
33
33
  else
34
34
  recaptcha_error(
@@ -74,8 +74,11 @@ module Recaptcha
74
74
 
75
75
  def recaptcha_error(model, attribute, message, key, default)
76
76
  message = message || Recaptcha.i18n(key, default)
77
- flash[:recaptcha_error] = message if recaptcha_flash_supported?
78
- model.errors.add attribute, message if model
77
+ if model
78
+ model.errors.add attribute, message
79
+ else
80
+ flash[:recaptcha_error] = message if recaptcha_flash_supported?
81
+ end
79
82
  end
80
83
 
81
84
  def recaptcha_flash_supported?
@@ -1,3 +1,3 @@
1
1
  module Recaptcha
2
- VERSION = "1.2.0"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: recaptcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason L Perry
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-29 00:00:00.000000000 Z
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json