method
string_to_date
string_to_date(string)
public
Hide source
# File activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb, line 105 def self.string_to_date(string) return string unless string.is_a?(String) date_array = ParseDate.parsedate(string) # treat 0000-00-00 as nil Date.new(date_array[0], date_array[1], date_array[2]) rescue nil end