Commit 47e8eade authored by Kamil Trzciński's avatar Kamil Trzciński

Update `Geo` connection_class

This makes `Geo::TrackingBase` to be marked as a connectio class
which makes it easy to discover all classes that hold connections.
parent 35eaf35c
...@@ -10,6 +10,12 @@ module Geo ...@@ -10,6 +10,12 @@ module Geo
SecondaryNotConfigured = Class.new(StandardError) SecondaryNotConfigured = Class.new(StandardError)
if ::Gitlab::Geo.geo_database_configured? if ::Gitlab::Geo.geo_database_configured?
# Mark current model as a `connection_class`
# This is the behavior when executing `connects_to`
# which indicates that given class is holding a connection object
# and should be treated accordingly.
self.connection_class = true
establish_connection Rails.configuration.geo_database establish_connection Rails.configuration.geo_database
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment