summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brandl <abrandl@gitlab.com>2018-02-26 19:39:08 +0100
committerAndreas Brandl <abrandl@gitlab.com>2018-03-06 12:53:13 +0100
commit4418066e2e33cec583a2df9be2132f4f698f5c8c (patch)
treebefc2e1078f68d8339c4f6d961e94be44cec848e
parent375a5c9f1e69a5fbf49a98cecc7f0c0cb61df989 (diff)
downloadgitlab-ce-4418066e2e33cec583a2df9be2132f4f698f5c8c.tar.gz
Flush cached information about schema.
This is only relevant for migration specs. See spec/support/migrations_helpers.rb.
-rw-r--r--app/models/user_contributed_projects.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/app/models/user_contributed_projects.rb b/app/models/user_contributed_projects.rb
index 2965b956f3f..624d41e3526 100644
--- a/app/models/user_contributed_projects.rb
+++ b/app/models/user_contributed_projects.rb
@@ -43,6 +43,12 @@ class UserContributedProjects < ActiveRecord::Base
@available_flag ||= ActiveRecord::Migrator.current_version >= REQUIRED_SCHEMA_VERSION # rubocop:disable Gitlab/PredicateMemoization
end
+ # Flushes cached information about schema
+ def reset_column_information
+ @available_flag = nil
+ super
+ end
+
private
def cached_exists?(project_id:, user_id:, &block)