fix-33733.patch

Yuichi HARADA, 2020-07-15 07:38

Download (1.13 KB)

View differences:

app/models/project.rb
122 122
      self.enabled_module_names = Setting.default_projects_modules
123 123
    end
124 124
    if !initialized.key?('trackers') && !initialized.key?('tracker_ids')
125
      default = Setting.default_projects_tracker_ids
125
      default = Setting.default_projects_tracker_ids.presence
126 126
      if default.is_a?(Array)
127 127
        self.trackers = Tracker.where(:id => default.map(&:to_i)).sorted.to_a
128 128
      else
test/unit/project_test.rb
92 92
    end
93 93
  end
94 94

  
95
  def test_default_trackers_should_be_empty_with_empty_setting
95
  def test_default_trackers_should_be_all_trackers_with_empty_setting
96 96
    with_settings :default_projects_tracker_ids => [] do
97
      assert_equal [], Project.new.trackers
97
      assert_equal Tracker.all.sort, Project.new.trackers.sort
98 98
    end
99 99
  end
100 100