Commit d0871007 authored by Stan Hu's avatar Stan Hu

Merge branch 'bw-fix-geo-eager-load' into 'master'

'sha_attribute' causes error when Geo is not enabled

See merge request gitlab-org/gitlab-ee!5276
parents bf2c9ba7 a89d95a8
......@@ -2,9 +2,9 @@ module ShaAttribute
extend ActiveSupport::Concern
module ClassMethods
def sha_attribute(name)
def sha_attribute(name, database_available = true)
return if ENV['STATIC_VERIFICATION']
return unless table_exists?
return unless database_available && table_exists?
column = columns.find { |c| c.name == name.to_s }
......
......@@ -10,8 +10,8 @@ class Geo::ProjectRegistry < Geo::BaseRegistry
ignore_column :repository_verification_checksum
ignore_column :wiki_verification_checksum
sha_attribute :repository_verification_checksum_sha
sha_attribute :wiki_verification_checksum_sha
sha_attribute :repository_verification_checksum_sha, ::Gitlab::Geo.geo_database_configured?
sha_attribute :wiki_verification_checksum_sha, ::Gitlab::Geo.geo_database_configured?
belongs_to :project
......
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