OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
make rubocop happier
Christophe Bliarda16d1cda9a19
diff --git a/modules/storages/app/cells/storages/projects_storages_table_cell.rb b/modules/storages/app/cells/storages/projects_storages_table_cell.rbindex cd7ee97a76c..197037cd234 100644--- a/modules/storages/app/cells/storages/projects_storages_table_cell.rb+++ b/modules/storages/app/cells/storages/projects_storages_table_cell.rb@@ -38,6 +38,5 @@ module Storages['created_at', { caption: Storages::ProjectStorage.human_attribute_name(:created_at) }]]end-endenddiff --git a/modules/storages/app/cells/storages/storages_row_cell.rb b/modules/storages/app/cells/storages/storages_row_cell.rbindex 515edc2e905..4a8188273ed 100644--- a/modules/storages/app/cells/storages/storages_row_cell.rb+++ b/modules/storages/app/cells/storages/storages_row_cell.rb@@ -8,13 +8,8 @@ module Storageslink_to model.name, storage_path(model)end- def host- model.host- end-- def provider_type- model.provider_type- end+ delegate :host, to: :model+ delegate :provider_type, to: :modeldef creatoricon = avatar model.creator, size: :minidiff --git a/modules/storages/app/controllers/storages/admin/projects_storages_controller.rb b/modules/storages/app/controllers/storages/admin/projects_storages_controller.rbindex c148ecc4c3b..566252ba555 100644--- a/modules/storages/app/controllers/storages/admin/projects_storages_controller.rb+++ b/modules/storages/app/controllers/storages/admin/projects_storages_controller.rb@@ -61,7 +61,7 @@ class Storages::Admin::ProjectsStoragesController < Projects::SettingsControllerenddef destroy- Storages::FileLink.joins(:container).where("work_packages.project_id = ?", @project.id).delete_all+ Storages::FileLink.joins(:container).where(work_packages: { project_id: @project.id }).delete_all@object.destroyredirect_to project_settings_projects_storages_pathdiff --git a/modules/storages/app/models/storages/file_link.rb b/modules/storages/app/models/storages/file_link.rbindex cba5820f24f..305a8b36d0f 100644--- a/modules/storages/app/models/storages/file_link.rb+++ b/modules/storages/app/models/storages/file_link.rb@@ -28,8 +28,8 @@class Storages::FileLink < ApplicationRecordbelongs_to :storage- belongs_to :creator, foreign_key: 'creator_id', class_name: 'User'- belongs_to :container, foreign_key: 'container_id', class_name: 'WorkPackage' # This needs to become more flexible in the future+ belongs_to :creator, class_name: 'User'+ belongs_to :container, class_name: 'WorkPackage' # This needs to become more flexible in the futurescope :visible, ->(user = User.current) {includes(:container)diff --git a/modules/storages/spec/features/admin_storages_spec.rb b/modules/storages/spec/features/admin_storages_spec.rbindex 05afd2e65ba..e579b9b528e 100644--- a/modules/storages/spec/features/admin_storages_spec.rb+++ b/modules/storages/spec/features/admin_storages_spec.rb@@ -95,6 +95,6 @@ describe 'Admin storages', type: :feature, js: true dopage.driver.browser.switch_to.alert.acceptexpect(page).to have_current_path(storages_path)- expect(page).to_not have_text("Other NC")+ expect(page).not_to have_text("Other NC")endenddiff --git a/modules/storages/spec/models/storage_spec.rb b/modules/storages/spec/models/storage_spec.rbindex 5e437eba0ba..60be43572fb 100644--- a/modules/storages/spec/models/storage_spec.rb+++ b/modules/storages/spec/models/storage_spec.rb@@ -43,34 +43,34 @@ describe ::Storages::Storage, type: :model doexpect(storage).to be_validend- it "should fail the validation if name is empty string" do+ it "fails the validation if name is empty string" doexpect(described_class.create(test_default_attributes.merge({ name: "" }))).to be_invalidend- it "should fail the validation if name is nil" do+ it "fails the validation if name is nil" doexpect(described_class.create(test_default_attributes.merge({ name: nil }))).to be_invalidend- it "should fail the validation if host is empty string" do+ it "fails the validation if host is empty string" doexpect(described_class.create(test_default_attributes.merge({ host: '' }))).to be_invalidend- it "should fail the validation if host is nil" do+ it "fails the validation if host is nil" doexpect(described_class.create(test_default_attributes.merge({ host: nil }))).to be_invalidend- context "having already one instance" do+ context "when having already one instance" dolet(:old_storage) { described_class.create test_default_attributes }before doold_storageend- it "should fail the validation if name is not unique" do+ it "fails the validation if name is not unique" doexpect(described_class.create(test_default_attributes.merge({ host: 'https://example2.com' }))).to be_invalidend- it "should fail the validation if host is not unique" do+ it "fails the validation if host is not unique" doexpect(described_class.create(test_default_attributes.merge({ name: 'NC 2' }))).to be_invalidendend@@ -87,7 +87,7 @@ describe ::Storages::Storage, type: :model dostorage.destroyend- it "should destroy all associated ProjectStorage and FileLink records" do+ it "destroys all associated ProjectStorage and FileLink records" doexpect(Storages::ProjectStorage.count).to be 0expect(Storages::FileLink.count).to be 0end