lib/koine/attributes/adapter/date.rb in koine-attributes-1.0.0 vs lib/koine/attributes/adapter/date.rb in koine-attributes-1.1.0
- old
+ new
@@ -3,13 +3,15 @@
module Adapter
class Date < Base
private
def coerce_not_nil(date)
- secure do
- next date if date.is_a?(::Date)
- next date.to_date if date.is_a?(::Time)
- ::Date.parse(date)
+ wrap_errors do
+ secure do
+ next date if date.is_a?(::Date)
+ next date.to_date if date.is_a?(::Time)
+ ::Date.parse(date)
+ end
end
end
end
end
end