cerulean 0.14.1 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cerulean.rb +9 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 158a16f764d2631111f759cbe37b6c45027035f0
|
4
|
+
data.tar.gz: df93866c6d73c33d6d9d4c1269a832cef74cbb4e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6515ac59370273c8eda93abfd25160dd3371510b31d5e70e1763f7d4c57fbec0ed4298258069f105bcbac491fc55cfb3d54dcee06199622e35f80118e3949d5b
|
7
|
+
data.tar.gz: 99c198a046b731cdae3388af1a9c508e40fae290f3cd9d3c2c1a94618883adcc76bc5d9711bcc9790694c22499ea89988cd2adf5a08bb9f1a297081f8bcbee58
|
data/lib/cerulean.rb
CHANGED
@@ -108,6 +108,14 @@ module Cerulean
|
|
108
108
|
else
|
109
109
|
if type == String
|
110
110
|
val
|
111
|
+
elsif type == Boolean
|
112
|
+
if val.blank? || val.downcase == 'null'
|
113
|
+
nil
|
114
|
+
elsif val.downcase == 'true'
|
115
|
+
true
|
116
|
+
else
|
117
|
+
false
|
118
|
+
end
|
111
119
|
elsif type == Date
|
112
120
|
Date.parse(val) rescue nil
|
113
121
|
elsif type == DateTime
|
@@ -139,7 +147,7 @@ module Cerulean
|
|
139
147
|
if params.has_key?(param.to_s)
|
140
148
|
p = validate_param_type(params[param.to_s], opts[:type])
|
141
149
|
|
142
|
-
if p.nil?
|
150
|
+
if p.nil? && opts[:null] != true
|
143
151
|
errors[param] ||= []
|
144
152
|
errors[param] << "#{param.to_s} is not a #{opts[:type].to_s.downcase}"
|
145
153
|
else
|