File tree 2 files changed +16
-0
lines changed
lib/active_record/connection_adapters/postgresql/oid
test/cases/adapters/postgresql
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,13 @@ class Timestamp < DateTime # :nodoc:
8
8
def type
9
9
real_type_unless_aliased ( :timestamp )
10
10
end
11
+
12
+ def ==( other )
13
+ precision == other . precision &&
14
+ scale == other . scale &&
15
+ limit == other . limit &&
16
+ type == other . type
17
+ end
11
18
end
12
19
end
13
20
end
Original file line number Diff line number Diff line change @@ -715,6 +715,15 @@ def test_disable_extension_without_schema
715
715
@connection . execute ( "DROP EXTENSION IF EXISTS hstore" )
716
716
end
717
717
718
+ def test_time_zone_converter_equals_to_timestamp
719
+ subtype = ActiveRecord ::ConnectionAdapters ::PostgreSQL ::OID ::Timestamp . new
720
+ value = ActiveRecord ::AttributeMethods ::TimeZoneConversion ::TimeZoneConverter . new ( subtype )
721
+
722
+ value_from_cache = Marshal . load ( Marshal . dump ( value ) )
723
+
724
+ assert_equal value , value_from_cache
725
+ end
726
+
718
727
private
719
728
def with_postgresql_apdater_decode_dates
720
729
PostgreSQLAdapter . decode_dates = true
You can’t perform that action at this time.
0 commit comments