diff options
author | Alex Kalderimis <alex.kalderimis@gmail.com> | 2019-07-30 11:11:56 -0400 |
---|---|---|
committer | Alex Kalderimis <alex.kalderimis@gmail.com> | 2019-07-30 19:27:56 -0400 |
commit | dd7f12906877fd3ef8ceabf836b97514a69e8620 (patch) | |
tree | 14de6bd46f205a74fac5eea5afe48e267211ba63 | |
parent | ac228e3f34c3ade20a948bad473055c606cc14fc (diff) | |
download | gitlab-ce-ajk-db-seeds.tar.gz |
Fixes development DB fixturesajk-db-seeds
Adds nil-safe method calls, uses arguments correctly
-rw-r--r-- | app/policies/project_policy.rb | 2 | ||||
-rw-r--r-- | db/fixtures/development/03_project.rb | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index e79bac6bee3..8bc0c936039 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -501,7 +501,7 @@ class ProjectPolicy < BasePolicy end def feature_available?(feature) - case project.project_feature.access_level(feature) + case project.project_feature&.access_level(feature) when ProjectFeature::DISABLED false when ProjectFeature::PRIVATE diff --git a/db/fixtures/development/03_project.rb b/db/fixtures/development/03_project.rb index 46018cf68aa..e3e2e9bf0a7 100644 --- a/db/fixtures/development/03_project.rb +++ b/db/fixtures/development/03_project.rb @@ -90,14 +90,14 @@ Sidekiq::Testing.inline! do # since the Sidekiq::Testing block has already exited. Force clearing # the `after_commit` queue to ensure the job is run now. project.send(:_run_after_commit_queue) - project.import_state.send(:_run_after_commit_queue) + project.import_state&.send(:_run_after_commit_queue) end if project.valid? && project.valid_repo? print '.' else - puts project.errors.full_messages - print 'F' + puts "F (#{project.name})" + project.errors.full_messages.each { |m| puts m.red } end end |