active_session 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/active_session.rb +0 -1
- data/lib/active_session/version.rb +1 -1
- metadata +5 -6
- data/lib/authenticity_validator.rb +0 -7
data/lib/active_session.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_session
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -14,7 +14,7 @@ date: 2011-10-24 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activemodel
|
17
|
-
requirement: &
|
17
|
+
requirement: &19397680 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: 3.1.1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *19397680
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: activesupport
|
28
|
-
requirement: &
|
28
|
+
requirement: &19397180 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,7 +33,7 @@ dependencies:
|
|
33
33
|
version: 3.1.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *19397180
|
37
37
|
description: ActiveModel session
|
38
38
|
email:
|
39
39
|
- qoobaa@gmail.com
|
@@ -52,7 +52,6 @@ files:
|
|
52
52
|
- lib/active_session/base.rb
|
53
53
|
- lib/active_session/errors.rb
|
54
54
|
- lib/active_session/version.rb
|
55
|
-
- lib/authenticity_validator.rb
|
56
55
|
- test/helper.rb
|
57
56
|
homepage: ''
|
58
57
|
licenses: []
|
@@ -1,7 +0,0 @@
|
|
1
|
-
class AuthenticityValidator < ActiveModel::EachValidator
|
2
|
-
def validate_each(record, attribute, value)
|
3
|
-
authenticating_record = options[:of] ? record.send(options[:of]) : record
|
4
|
-
authentic = authenticating_record ? authenticating_record.authenticate(value) : true
|
5
|
-
record.errors.add(attribute, :invalid) unless authentic
|
6
|
-
end
|
7
|
-
end
|