lib/koine/attributes/adapter/date.rb in koine-attributes-1.2.3 vs lib/koine/attributes/adapter/date.rb in koine-attributes-1.2.4
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module Koine
module Attributes
module Adapter
class Date < Base
private
@@ -7,9 +9,10 @@
def coerce_not_nil(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