Skip to content

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

Removes unecessary code and updates migration

Marcello Rochab3e2aade9b9b
diff --git a/db/migrate/20230713144232_create_storages_file_link_journals.rb b/db/migrate/20230713144232_create_storages_file_link_journals.rb
index ca1dce77fe8..0061722e926 100644
--- a/db/migrate/20230713144232_create_storages_file_link_journals.rb
+++ b/db/migrate/20230713144232_create_storages_file_link_journals.rb
@@ -32,10 +32,10 @@ class CreateStoragesFileLinkJournals < ActiveRecord::Migration[7.0]
def change
# rubocop:disable Rails/CreateTableWithTimestamps
create_table :storages_file_links_journals do |t|
- t.belongs_to :journal
- t.belongs_to :file_link
+ t.belongs_to :journal, null: false, foreign_key: true
+ t.belongs_to :file_link, null: false
- t.string :link_name, default: ''
+ t.string :link_name, null: false
end
# rubocop:enable Rails/CreateTableWithTimestamps
end
diff --git a/lib/open_project/journal/attachment_helper.rb b/lib/open_project/journal/attachment_helper.rb
index f3d6a0f81b4..3149e3acdda 100644
--- a/lib/open_project/journal/attachment_helper.rb
+++ b/lib/open_project/journal/attachment_helper.rb
@@ -35,13 +35,6 @@ module OpenProject
save
end
end
-
- def file_links_changed(_obj)
- unless new_record?
- add_journal
- save
- end
- end
end
end
end