tracking_base.rb 462 Bytes
Newer Older
1
# This module is intended to centralize all database access to the secondary
Stan Hu's avatar
Stan Hu committed
2
# tracking database for Geo.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
module Geo
  class TrackingBase < ActiveRecord::Base
    self.abstract_class = true

    if ::Gitlab::Geo.geo_database_configured?
      establish_connection Rails.configuration.geo_database
    end

    def self.connection
      raise 'Geo secondary database is not configured' unless ::Gitlab::Geo.geo_database_configured?

      super
    end
  end
end