aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorRaimonds Simanovskis <raimonds.simanovskis@gmail.com>2009-08-10 17:25:53 +0300
committerRaimonds Simanovskis <raimonds.simanovskis@gmail.com>2010-06-04 22:44:02 +0300
commit8136230cca4ff7550f9fbc786a4327bd520d27cb (patch)
treebf7849716de791c9925d85eedaa16f35bf0f0918 /activerecord/test/models
parenteec90bab2815642d1771c9f9c37bd5a0bcd6fc9d (diff)
downloadrails-8136230cca4ff7550f9fbc786a4327bd520d27cb.tar.gz
rails-8136230cca4ff7550f9fbc786a4327bd520d27cb.tar.bz2
rails-8136230cca4ff7550f9fbc786a4327bd520d27cb.zip
Explicitly set Topic model last_read attribute as Date value when Oracle enhanced adapter is used
(otherwise some tests are failing which assume that this attribute will have Date value)
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/topic.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb
index 91fc7c9416..617f01b47d 100644
--- a/activerecord/test/models/topic.rb
+++ b/activerecord/test/models/topic.rb
@@ -43,6 +43,12 @@ class Topic < ActiveRecord::Base
before_create :default_written_on
before_destroy :destroy_children
+ # Explicitly define as :date column so that returned Oracle DATE values would be typecasted to Date and not Time.
+ # Some tests depend on assumption that this attribute will have Date values.
+ if current_adapter?(:OracleEnhancedAdapter)
+ set_date_columns :last_read
+ end
+
def parent
Topic.find(parent_id)
end