Skip to content

Commit bcebc09

Browse files
authored
Merge pull request rails#54353 from Edouard-chin/ec-fix-column
Fix column_definition returning a wrong column:
2 parents 59a42a9 + c1ff85f commit bcebc09

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

activerecord/lib/active_record/type/internal/timezone.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@ def is_utc?
1616
def default_timezone
1717
@timezone || ActiveRecord.default_timezone
1818
end
19+
20+
def ==(other)
21+
super(other) && timezone == other.timezone
22+
end
23+
24+
protected
25+
attr_reader :timezone
1926
end
2027
end
2128
end

activerecord/test/cases/base_test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,4 +1982,12 @@ def test_protected_environments_are_stored_as_an_array_of_string
19821982
assert_not ActiveRecord::Base.current_preventing_writes
19831983
end
19841984
end
1985+
1986+
private
1987+
def with_timezone_config(cfg, &block)
1988+
super(cfg) do
1989+
Default.reset_column_information
1990+
block.call
1991+
end
1992+
end
19851993
end

0 commit comments

Comments
 (0)