Skip to content

Commit f8d8183

Browse files
committed
Eliminate lease_connection call in Integration
1 parent 5bc1724 commit f8d8183

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

activerecord/lib/active_record/integration.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ def collection_cache_key(collection = all, timestamp_column = :updated_at) # :no
178178
def can_use_fast_cache_version?(timestamp)
179179
timestamp.is_a?(String) &&
180180
cache_timestamp_format == :usec &&
181-
self.class.lease_connection.default_timezone == :utc &&
181+
# FIXME: checking out a connection for this is wasteful
182+
# we should store/cache this information in the schema cache
183+
# or similar.
184+
self.class.with_connection(&:default_timezone) == :utc &&
182185
!updated_at_came_from_user?
183186
end
184187

0 commit comments

Comments
 (0)