-
Notifications
You must be signed in to change notification settings - Fork 731
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #4753 - Vendor url in installed package is the zammad instance …
…url. Co-authored-by: Florian Liebe <fl@zammad.com>
- Loading branch information
1 parent
97b3d6a
commit 8284610
Showing
5 changed files
with
29 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright (C) 2012-2023 Zammad Foundation, https://zammad-foundation.org/ | ||
|
||
class ShowPackageUrl < ActiveRecord::Migration[6.1] | ||
def change | ||
# return if it's a new setup | ||
return if !Setting.exists?(name: 'system_init_done') | ||
|
||
add_column :packages, :url, :string, limit: 512 | ||
Package.reset_column_information | ||
|
||
Package.find_each do |package| | ||
json_file = Package._get_bin(package.name, package.version) | ||
data = JSON.parse(json_file) | ||
next if data['url'].blank? | ||
|
||
package.update!(url: data['url']) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters