Don't cast nil or empty strings to a dummy date. Closes #2789.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2966 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
Jeremy Kemper
2005-11-10 06:56:01 +00:00
parent c91088cd13
commit df7a087c76
2 changed files with 3 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
*SVN*
* Don't cast nil or empty strings to a dummy date. #2789 [Rick Bradley <rick@rickbradley.com>]
* acts_as_list plays nicely with inheritance by remembering the class which declared it. #2811 [rephorm@rephorm.com]
* Fix sqlite adaptor's detection of missing dbfile or database declaration. [Nicholas Seckar]

View File

@@ -110,6 +110,7 @@ begin
def cast_to_date_or_time(value)
return value if value.is_a? Date
return nil if value.blank?
guess_date_or_time (value.is_a? Time) ? value : cast_to_time(value)
end