lib/virtus/multiparams.rb in virtus-multiparams-0.1.0 vs lib/virtus/multiparams.rb in virtus-multiparams-0.1.1
- old
+ new
@@ -36,10 +36,12 @@
attributes[name] =
if attribute.primitive <= Date || attribute.primitive <= Time
# Basic convesion is enough, Virtus invokes `to_date[time]`
# Also, lololol timezones
- Time.new(*array[0...6]) unless array[0...3].any? { |param| param.nil? || param == 0 }
+ if array.length >= 3 && array[0...3].none?(&:nil?) && array[0...3].none?(&:zero?)
+ Time.new(*array[0...6])
+ end
else
array
end
end
end