diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-01-08 20:02:53 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-01-08 20:02:53 +0000 |
commit | b29d74f9d5dfcbc348759ae35a40b586f9a862e0 (patch) | |
tree | f689ac5c117e46b6d4897b031023d208d2ff32d9 /lib | |
parent | cc47ccb1c2a5c40cde304f1b1358c1f9ee06301b (diff) | |
download | redmine-b29d74f9d5dfcbc348759ae35a40b586f9a862e0.tar.gz redmine-b29d74f9d5dfcbc348759ae35a40b586f9a862e0.zip |
Workaround for #12750.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11138 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r-- | lib/redmine/core_ext/active_record.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/redmine/core_ext/active_record.rb b/lib/redmine/core_ext/active_record.rb index 69bf76adc..5eab1cb6c 100644 --- a/lib/redmine/core_ext/active_record.rb +++ b/lib/redmine/core_ext/active_record.rb @@ -43,7 +43,8 @@ class DateValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) before_type_cast = record.attributes_before_type_cast[attribute.to_s] if before_type_cast.is_a?(String) && before_type_cast.present? - unless before_type_cast =~ /\A\d{4}-\d{2}-\d{2}\z/ && value + # TODO: #*_date_before_type_cast returns a Mysql::Time with ruby1.8+mysql gem + unless before_type_cast =~ /\A\d{4}-\d{2}-\d{2}( 00:00:00)?\z/ && value record.errors.add attribute, :not_a_date end end |