activemodel 4.0.1.rc2 → 4.0.1.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_model/validations/clusivity.rb +11 -5
- data/lib/active_model/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6fe60de7e5c7a1f28e5d087b0c1b039f2e94e7c
|
4
|
+
data.tar.gz: 1f3891829242a2891d6297f2a709891ec717dca1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 128e07279b0c3a32cdcd06a080f19e1207f0f84c923c394dcf6524e9f035f309299e99f87ffed1361681151a27c9d93dc93723084c33a88dc779707d4e3d5909
|
7
|
+
data.tar.gz: 83d1692031a9909a16883668597f1739588d90712b85c8d97e83e9382f12af3e365c55374aea8e7193b27534f6285d53fe85a87398adc0d656b02cee024cac4d
|
@@ -30,12 +30,18 @@ module ActiveModel
|
|
30
30
|
@delimiter ||= options[:in] || options[:within]
|
31
31
|
end
|
32
32
|
|
33
|
-
# In Ruby 1.9 <tt>Range#include?</tt> on non-
|
34
|
-
# range for equality, which is slower but more accurate.
|
35
|
-
# the previous logic of comparing a value with the range
|
36
|
-
# but is only accurate on
|
33
|
+
# In Ruby 1.9 <tt>Range#include?</tt> on non-number-or-time-ish ranges checks all
|
34
|
+
# possible values in the range for equality, which is slower but more accurate.
|
35
|
+
# <tt>Range#cover?</tt> uses the previous logic of comparing a value with the range
|
36
|
+
# endpoints, which is fast but is only accurate on Numeric, Time, or DateTime ranges.
|
37
37
|
def inclusion_method(enumerable)
|
38
|
-
|
38
|
+
return :include? unless enumerable.is_a?(Range)
|
39
|
+
case enumerable.first
|
40
|
+
when Numeric, Time, DateTime
|
41
|
+
:cover?
|
42
|
+
else
|
43
|
+
:include?
|
44
|
+
end
|
39
45
|
end
|
40
46
|
end
|
41
47
|
end
|
data/lib/active_model/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activemodel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.1.
|
4
|
+
version: 4.0.1.rc3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 4.0.1.
|
19
|
+
version: 4.0.1.rc3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 4.0.1.
|
26
|
+
version: 4.0.1.rc3
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: builder
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|