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
refactor: add description column by adding it to the columns array
Christophe Bliard1d517ec26e78
diff --git a/app/models/work_package/exports/csv.rb b/app/models/work_package/exports/csv.rbindex 03acf053380..d5cb2866bed 100644--- a/app/models/work_package/exports/csv.rb+++ b/app/models/work_package/exports/csv.rb@@ -33,35 +33,26 @@ module WorkPackage::Exportsalias :records :work_packages+ def get_columns+ if with_descriptions+ super + [description_column]+ else+ super+ end+ end+privatedef titlequery.new_record? ? I18n.t(:label_work_package_plural) : query.nameend- def csv_headers- return super unless with_descriptions-- super + [WorkPackage.human_attribute_name(:description)]- end-def with_descriptionsActiveModel::Type::Boolean.new.cast(options[:show_descriptions])end- # fetch all row values- def csv_row(work_package)- return super unless with_descriptions-- super.tap do |row|- if row.any?- row << if work_package.description- work_package.description.squish- else- ""- end- end- end+ def description_column+ Queries::WorkPackages::Selects::PropertySelect.new(:description)endendend