Closed yez closed 8 years ago
@oriolgual @txus This should Resolve #48.
Given a test model:
class TestModel attr_accessor :foo validates :foo, date: true def initialize(date) @foo = date end end
Behaviour before this patch:
m = TestModel.new('not a date') m.valid? => true
Behaviour after this patch:
m = TestModel.new('not a date') m.valid? => false
The only outstanding question is should a string like 2016-01-08 go through Date.parse or to_date to try and make it valid.
2016-01-08
Date.parse
to_date
Thanks!
@oriolgual @txus This should Resolve #48.
Given a test model:
Behaviour before this patch:
Behaviour after this patch:
The only outstanding question is should a string like
2016-01-08
go throughDate.parse
orto_date
to try and make it valid.