You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently upgraded our rails application from rails 3.2 and ruby 1.9.3 (activerecord-oracle_enhanced-adapter 1.4.3) to rails 4.2.7 and ruby 2.3.1 (activerecord-oracle_enhanced-adapter 1.6.7). But I ran in to an issue with the Oracle timestamp field. It ignores the time zone set by Time.use_zone. But the date field still works as in the previous version.
CREATE TABLE TESTS
( ID NUMBER NOT NULL
, TIMESTAMP_FIELD TIMESTAMP
, DATE_FIELD DATE
, CONSTRAINT TEST_PK PRIMARY KEY
( ID )
ENABLE
);
In the rails 3.2 the timestamp_field did get affected by the Time.use_zone and showed the same time as date_field when using the Time.use_zone.
> Test.find_by_id(1).timestamp_field.class
Time
> Test.find_by_id(1).date_field.class
ActiveSupport::TimeWithZone
In rails 3.2 the timestamp_field is implemented by ActiveSupport::TimeWithZone as is data_field. So the different implementation is causing a problem for us. Is it possible to let a timestamp field act like an ActiveSupport::TimeWithZone?
The text was updated successfully, but these errors were encountered:
Since I was trying to reproduce it but unable to reproduce this result. timestamp_field and date_field have 2 hour difference at this point but my result is always same.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
We recently upgraded our rails application from rails 3.2 and ruby 1.9.3 (activerecord-oracle_enhanced-adapter 1.4.3) to rails 4.2.7 and ruby 2.3.1 (activerecord-oracle_enhanced-adapter 1.6.7). But I ran in to an issue with the Oracle timestamp field. It ignores the time zone set by Time.use_zone. But the date field still works as in the previous version.
application.rb
rails c (in our rails 4.2 application)
In the rails 3.2 the timestamp_field did get affected by the Time.use_zone and showed the same time as date_field when using the Time.use_zone.
In rails 3.2 the timestamp_field is implemented by ActiveSupport::TimeWithZone as is data_field. So the different implementation is causing a problem for us. Is it possible to let a timestamp field act like an ActiveSupport::TimeWithZone?
The text was updated successfully, but these errors were encountered: