From dd7f12906877fd3ef8ceabf836b97514a69e8620 Mon Sep 17 00:00:00 2001 From: Alex Kalderimis Date: Tue, 30 Jul 2019 11:11:56 -0400 Subject: Fixes development DB fixtures Adds nil-safe method calls, uses arguments correctly --- app/policies/project_policy.rb | 2 +- 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 -- cgit v1.2.1