glebtv-simple_captcha 0.4.1 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -8,6 +8,14 @@ adding up a single line in views and in controllers/models.
8
8
  SimpleCaptcha is available to be used with Rails 3 or above and also it provides the
9
9
  backward compatibility with previous versions of Rails.
10
10
 
11
+ == For mongoid support
12
+
13
+ Just do
14
+
15
+ include SimpleCaptcha::ModelHelpers
16
+
17
+ in your model, besides usual AR instructions
18
+
11
19
  ==Features
12
20
 
13
21
  * Zero FileSystem usage(secret code moved to db-store and image storage removed).
@@ -54,7 +54,8 @@ module SimpleCaptcha #:nodoc
54
54
  end
55
55
 
56
56
  def is_captcha_valid?
57
- if captcha && captcha.upcase.delete(" ") == SimpleCaptcha::Utils::simple_captcha_value(captcha_key)
57
+ v = SimpleCaptcha::Utils::simple_captcha_value(captcha_key)
58
+ if captcha && !v.nil? && captcha.upcase.delete(" ") == v.upcase
58
59
  SimpleCaptcha::Utils::simple_captcha_passed!(captcha_key)
59
60
  return true
60
61
  else
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module SimpleCaptcha
3
- VERSION = "0.4.1".freeze
3
+ VERSION = "0.4.3".freeze
4
4
  end
@@ -21,9 +21,9 @@ module SimpleCaptcha
21
21
  autoload :SimpleCaptchaData, File.dirname(__FILE__) + '/simple_captcha/storage/mongoid'
22
22
  else
23
23
  autoload :SimpleCaptchaData, File.dirname(__FILE__) + '/simple_captcha/storage/active_record'
24
- autoload :ModelHelpers, File.dirname(__FILE__) + '/simple_captcha/active_record'
25
24
  end
26
-
25
+
26
+ autoload :ModelHelpers, File.dirname(__FILE__) + '/simple_captcha/model_helpers'
27
27
  autoload :Middleware, File.dirname(__FILE__) + '/simple_captcha/middleware'
28
28
 
29
29
  mattr_accessor :image_size
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glebtv-simple_captcha
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-19 00:00:00.000000000 Z
12
+ date: 2013-03-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -39,6 +39,7 @@ files:
39
39
  - lib/generators/templates/partial.erb
40
40
  - lib/generators/templates/migration.rb
41
41
  - lib/generators/USAGE
42
+ - lib/simple_captcha/model_helpers.rb
42
43
  - lib/simple_captcha/controller.rb
43
44
  - lib/simple_captcha/storage/mongoid.rb
44
45
  - lib/simple_captcha/storage/active_record.rb
@@ -50,7 +51,6 @@ files:
50
51
  - lib/simple_captcha/engine.rb
51
52
  - lib/simple_captcha/image.rb
52
53
  - lib/simple_captcha/utils.rb
53
- - lib/simple_captcha/active_record.rb
54
54
  - lib/simple_captcha/version.rb
55
55
  - Rakefile
56
56
  - README.rdoc
@@ -75,9 +75,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  version: '0'
76
76
  requirements: []
77
77
  rubyforge_project:
78
- rubygems_version: 1.8.25
78
+ rubygems_version: 1.8.22
79
79
  signing_key:
80
80
  specification_version: 3
81
81
  summary: A fork of a fork of a fork of simple_captcha.
82
82
  test_files:
83
83
  - test/simple_captcha_test.rb
84
+ has_rdoc: