sexy_validations 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/sexy_validations/validators/presence.rb +8 -1
- data/sexy_validations.gemspec +1 -1
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
@@ -3,7 +3,14 @@ module SexyValidations
|
|
3
3
|
module Validators
|
4
4
|
class Presence
|
5
5
|
def self.validate(model, attribute, value, options)
|
6
|
-
|
6
|
+
real_value = case value.class.name
|
7
|
+
when "Sequel::Plugins::Paperclip::Attachment"
|
8
|
+
value.queued_file
|
9
|
+
else
|
10
|
+
value
|
11
|
+
end
|
12
|
+
|
13
|
+
return unless real_value.blank?
|
7
14
|
|
8
15
|
model.errors.add(attribute, "muss ausgefüllt werden")
|
9
16
|
end
|
data/sexy_validations.gemspec
CHANGED