mirror of
https://github.com/github/rails.git
synced 2026-01-27 23:38:11 -05:00
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:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user