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 +4 -4
- data/lib/recaptcha/verify.rb +6 -3
- data/lib/recaptcha/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3c89ffab2c2bcfb9e2310157d81cca7a6310eb7
|
4
|
+
data.tar.gz: 12e9212f8ec32eb1f67470fc0a0644a8570b1dae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 354b302b4061839590ac00b6c599c9d7317c1f8221e0ac3ef38ec514d52e459d0ecabbb347aaf1930a7e0aff8957e9835f122e8c73d8a7aba8763ddb6715a6d7
|
7
|
+
data.tar.gz: b1045a9e879f6267ba59a44e738c89bbaac29c5f52fa68b8421dc68ec0fc782dfdf2557d63b10cefc9bb013f44f9d3826fcdf292128055e12c20e9daad3fb397
|
data/lib/recaptcha/verify.rb
CHANGED
@@ -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
|
-
|
78
|
-
|
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?
|
data/lib/recaptcha/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2016-04-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|