strange validation in redmine core

Added by ilya boltnev over 5 years ago

I've developing redmine plugin, and discover this line of code in Version model:

validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :not_a_date, :allow_nil => true

I've changed Rails date format by adding


in initializer, and now I can't save my Version.

Two questions to developers:

1.Why do we need for this line? Are we need to validate effective_date of version so hard?

2.What should I do to solve this problem?