diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2019-03-03 14:51:58 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-03-03 14:51:58 +0900 |
commit | 67ebf49df3afad4355415a95ea9d08a39565a494 (patch) | |
tree | c155b824d18ec6de374308b6e803dcb1e17a50a5 /activerecord | |
parent | a9cc5e412b17f2b98d39fadd308939aa5f840310 (diff) | |
parent | df79aa31e9a731cae949805754618571cd5307ad (diff) | |
download | rails-67ebf49df3afad4355415a95ea9d08a39565a494.tar.gz rails-67ebf49df3afad4355415a95ea9d08a39565a494.tar.bz2 rails-67ebf49df3afad4355415a95ea9d08a39565a494.zip |
Merge pull request #35456 from yahonda/rails_datetime_mapped_to_oracle_timestamp
Rails `DateTime` type is mapped to Oracle `TIMESTAMP` since Rails 5.0
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/date_test.rb | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/activerecord/test/cases/date_test.rb b/activerecord/test/cases/date_test.rb index 9f412cdb63..2475d4a34b 100644 --- a/activerecord/test/cases/date_test.rb +++ b/activerecord/test/cases/date_test.rb @@ -23,23 +23,13 @@ class DateTest < ActiveRecord::TestCase valid_dates.each do |date_src| topic = Topic.new("last_read(1i)" => date_src[0].to_s, "last_read(2i)" => date_src[1].to_s, "last_read(3i)" => date_src[2].to_s) - # Oracle DATE columns are datetime columns and Oracle adapter returns Time value - if current_adapter?(:OracleAdapter) - assert_equal(topic.last_read.to_date, Date.new(*date_src)) - else - assert_equal(topic.last_read, Date.new(*date_src)) - end + assert_equal(topic.last_read, Date.new(*date_src)) end invalid_dates.each do |date_src| assert_nothing_raised do topic = Topic.new("last_read(1i)" => date_src[0].to_s, "last_read(2i)" => date_src[1].to_s, "last_read(3i)" => date_src[2].to_s) - # Oracle DATE columns are datetime columns and Oracle adapter returns Time value - if current_adapter?(:OracleAdapter) - assert_equal(topic.last_read.to_date, Time.local(*date_src).to_date, "The date should be modified according to the behavior of the Time object") - else - assert_equal(topic.last_read, Time.local(*date_src).to_date, "The date should be modified according to the behavior of the Time object") - end + assert_equal(topic.last_read, Time.local(*date_src).to_date, "The date should be modified according to the behavior of the Time object") end end end |