diff options
Diffstat (limited to 'app/presenters/packages/detail')
-rw-r--r-- | app/presenters/packages/detail/package_presenter.rb | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/app/presenters/packages/detail/package_presenter.rb b/app/presenters/packages/detail/package_presenter.rb index 59e50b96ab2..c257edcadfb 100644 --- a/app/presenters/packages/detail/package_presenter.rb +++ b/app/presenters/packages/detail/package_presenter.rb @@ -15,7 +15,7 @@ module Packages id: @package.id, created_at: @package.created_at, name: name, - package_files: @package.package_files.map { |pf| build_package_file_view(pf) }, + package_files: package_file_views, package_type: @package.package_type, status: @package.status, project_id: @package.project_id, @@ -38,6 +38,16 @@ module Packages private + def package_file_views + package_files = if Feature.enabled?(:packages_installable_package_files, default_enabled: :yaml) + @package.installable_package_files + else + @package.package_files + end + + package_files.map { |pf| build_package_file_view(pf) } + end + def build_package_file_view(package_file) file_view = { created_at: package_file.created_at, |