diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-20 14:40:11 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-01-20 14:40:11 +0000 |
commit | b40d3c9e62325512e167b6fccc7d9d1a60948faa (patch) | |
tree | b6207a770aae0bf1bd23b81a687eabe34104909b /activerecord/lib/active_record/connection_adapters | |
parent | db6688585f47d96f30ed1c253385e1053c789d2b (diff) | |
download | rails-b40d3c9e62325512e167b6fccc7d9d1a60948faa.tar.gz rails-b40d3c9e62325512e167b6fccc7d9d1a60948faa.tar.bz2 rails-b40d3c9e62325512e167b6fccc7d9d1a60948faa.zip |
Replaced === checks with is_a? checks #502, #82 [Marcel Molina]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@466 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters')
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/abstract_adapter.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index 9eaac85571..a2bab29b42 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -217,21 +217,21 @@ module ActiveRecord private def string_to_date(string) - return string if Date === string + return string if string.is_a?(Date) 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 def string_to_time(string) - return string if Time === string + return string if string.is_a?(Time) time_array = ParseDate.parsedate(string).compact # treat 0000-00-00 00:00:00 as nil Time.send(Base.default_timezone, *time_array) rescue nil end def string_to_dummy_time(string) - return string if Time === string + return string if string.is_a?(Time) time_array = ParseDate.parsedate(string) # pad the resulting array with dummy date information time_array[0] = 2000; time_array[1] = 1; time_array[2] = 1; |