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

rename fixed_version to version

ulferts0b15db3c9acf
diff --git a/app/contracts/projects/archive_contract.rb b/app/contracts/projects/archive_contract.rb
index 435b9893b00..5ab6e2931f0 100644
--- a/app/contracts/projects/archive_contract.rb
+++ b/app/contracts/projects/archive_contract.rb
@@ -50,7 +50,7 @@ module Projects
exists = WorkPackage
.where.not(project_id: model.self_and_descendants.select(:id))
- .where(fixed_version_id: version_ids)
+ .where(version_id: version_ids)
.exists?
errors.add :base, :foreign_wps_reference_version if exists
diff --git a/app/contracts/versions/delete_contract.rb b/app/contracts/versions/delete_contract.rb
index 129f61976d8..ec4b5d6d5ed 100644
--- a/app/contracts/versions/delete_contract.rb
+++ b/app/contracts/versions/delete_contract.rb
@@ -39,7 +39,7 @@ module Versions
protected
def validate_no_work_packages_attached
- return unless model.fixed_issues.exists?
+ return unless model.work_packages.exists?
errors.add(:base, :undeletable_work_packages_attached)
end
diff --git a/app/contracts/work_packages/base_contract.rb b/app/contracts/work_packages/base_contract.rb
index c427f986881..e8cc20ae934 100644
--- a/app/contracts/work_packages/base_contract.rb
+++ b/app/contracts/work_packages/base_contract.rb
@@ -44,9 +44,9 @@ module WorkPackages
attribute :type_id
attribute :priority_id
attribute :category_id
- attribute :fixed_version_id,
+ attribute :version_id,
permission: :assign_versions do
- validate_fixed_version_is_assignable
+ validate_version_is_assignable
end
validate :validate_no_reopen_on_closed_version
@@ -266,14 +266,14 @@ module WorkPackages
end
end
- def validate_fixed_version_is_assignable
- if model.fixed_version_id && !model.assignable_versions.map(&:id).include?(model.fixed_version_id)
- errors.add :fixed_version_id, :inclusion
+ def validate_version_is_assignable
+ if model.version_id && !model.assignable_versions.map(&:id).include?(model.version_id)
+ errors.add :version_id, :inclusion
end
end
def validate_no_reopen_on_closed_version
- if model.fixed_version_id && model.reopened? && model.fixed_version.closed?
+ if model.version_id && model.reopened? && model.version.closed?
errors.add :base, I18n.t(:error_can_not_reopen_work_package_on_closed_version)
end
end
@@ -371,7 +371,7 @@ module WorkPackages
end
def closed_version_and_status?(status = model.status)
- model.fixed_version&.closed? && status.is_closed?
+ model.version&.closed? && status.is_closed?
end
def new_statuses_by_workflow(status)
diff --git a/app/contracts/work_packages/copy_project_contract.rb b/app/contracts/work_packages/copy_project_contract.rb
index 371c4d3f4bc..f2e9ccba7c6 100644
--- a/app/contracts/work_packages/copy_project_contract.rb
+++ b/app/contracts/work_packages/copy_project_contract.rb
@@ -42,7 +42,7 @@ module WorkPackages
private
- def validate_fixed_version_is_assignable; end
+ def validate_version_is_assignable; end
def validate_no_reopen_on_closed_version; end
end
diff --git a/app/controllers/time_entries/reports_controller.rb b/app/controllers/time_entries/reports_controller.rb
index f3b3283d4c6..576b939c2d0 100644
--- a/app/controllers/time_entries/reports_controller.rb
+++ b/app/controllers/time_entries/reports_controller.rb
@@ -118,7 +118,7 @@ class TimeEntries::ReportsController < ApplicationController
@available_criterias = { 'project' => { sql: "#{TimeEntry.table_name}.project_id",
klass: Project,
label: Project.model_name.human },
- 'version' => { sql: "#{WorkPackage.table_name}.fixed_version_id",
+ 'version' => { sql: "#{WorkPackage.table_name}.version_id",
klass: Version,
label: Version.model_name.human },
'category' => { sql: "#{WorkPackage.table_name}.category_id",
diff --git a/app/controllers/versions_controller.rb b/app/controllers/versions_controller.rb
index 0a268daf079..0cee5b9c6de 100644
--- a/app/controllers/versions_controller.rb
+++ b/app/controllers/versions_controller.rb
@@ -56,7 +56,7 @@ class VersionsController < ApplicationController
def show
@issues = @version
- .fixed_issues
+ .work_packages
.visible
.includes(:status, :type, :priority)
.order("#{::Type.table_name}.position, #{WorkPackage.table_name}.id")
@@ -163,7 +163,7 @@ class VersionsController < ApplicationController
def work_packages_of_version(version, project_ids, selected_type_ids)
version
- .fixed_issues
+ .work_packages
.visible
.includes(:project, :status, :type, :priority)
.where(type_id: selected_type_ids, project_id: project_ids)
diff --git a/app/controllers/work_packages/moves_controller.rb b/app/controllers/work_packages/moves_controller.rb
index f8793bb66ba..dba3375f07e 100644
--- a/app/controllers/work_packages/moves_controller.rb
+++ b/app/controllers/work_packages/moves_controller.rb
@@ -161,7 +161,7 @@ class WorkPackages::MovesController < ApplicationController
:start_date,
:due_date,
:status_id,
- :fixed_version_id,
+ :version_id,
:priority_id)
.to_h
.reject { |_, v| v.blank? }
diff --git a/app/helpers/work_packages_filter_helper.rb b/app/helpers/work_packages_filter_helper.rb
index 4aae49d2c14..f310bc44cd4 100644
--- a/app/helpers/work_packages_filter_helper.rb
+++ b/app/helpers/work_packages_filter_helper.rb
@@ -34,7 +34,7 @@ module WorkPackagesFilterHelper
query = {
f: [
filter_object('status_id', 'c'),
- filter_object('fixed_version_id', '=', version.id)
+ filter_object('version_id', '=', version.id)
]
}
project_work_packages_with_query_path(version.project, query, options)
@@ -44,7 +44,7 @@ module WorkPackagesFilterHelper
query = {
f: [
filter_object('status_id', 'o'),
- filter_object('fixed_version_id', '=', version.id)
+ filter_object('version_id', '=', version.id)
]
}
project_work_packages_with_query_path(version.project, query, options)
@@ -104,7 +104,7 @@ module WorkPackagesFilterHelper
query = {
f: [
filter_object('status_id', '*'),
- filter_object('fixed_version_id', '=', version.id),
+ filter_object('version_id', '=', version.id),
filter_object(property_name, '=', property_id)
],
t: default_sort
diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb
index c95dfe86b1f..9106de39bfb 100644
--- a/app/models/mail_handler.rb
+++ b/app/models/mail_handler.rb
@@ -262,7 +262,8 @@ class MailHandler < ActionMailer::Base
container: container,
file: file,
author: user,
- content_type: attachment.mime_type)
+ content_type: attachment.mime_type
+ )
end
end
@@ -340,7 +341,7 @@ class MailHandler < ActionMailer::Base
'priority_id' => lookup_case_insensitive_key(IssuePriority, :priority),
'category_id' => lookup_case_insensitive_key(project.categories, :category),
'assigned_to_id' => assigned_to.try(:id),
- 'fixed_version_id' => lookup_case_insensitive_key(project.shared_versions, :fixed_version, Arel.sql("#{Version.table_name}.name")),
+ 'version_id' => lookup_case_insensitive_key(project.shared_versions, :version, Arel.sql("#{Version.table_name}.name")),
'start_date' => get_keyword(:start_date, override: true, format: '\d{4}-\d{2}-\d{2}'),
'due_date' => get_keyword(:due_date, override: true, format: '\d{4}-\d{2}-\d{2}'),
'estimated_hours' => get_keyword(:estimated_hours, override: true),
diff --git a/app/models/permitted_params.rb b/app/models/permitted_params.rb
index 894666aff3e..5a755513f77 100644
--- a/app/models/permitted_params.rb
+++ b/app/models/permitted_params.rb
@@ -527,7 +527,7 @@ class PermittedParams
:done_ratio,
:due_date,
:estimated_hours,
- :fixed_version_id,
+ :version_id,
:parent_id,
:priority_id,
:responsible_id,
diff --git a/app/models/projects/copy.rb b/app/models/projects/copy.rb
index f8ca6876541..d4be11cd9ed 100644
--- a/app/models/projects/copy.rb
+++ b/app/models/projects/copy.rb
@@ -156,7 +156,7 @@ module Projects::Copy
# so that parents get copied before their children.
to_copy = project
.work_packages
- .includes(:custom_values, :fixed_version, :assigned_to, :responsible)
+ .includes(:custom_values, :version, :assigned_to, :responsible)
.order_by_ancestors('asc')
.order('id ASC')
@@ -348,7 +348,7 @@ module Projects::Copy
{
project: self,
parent_id: parent_id,
- fixed_version: work_package_version(source_work_package),
+ version: work_package_version(source_work_package),
assigned_to: work_package_assigned_to(source_work_package),
responsible: work_package_responsible(source_work_package),
custom_field_values: custom_value_attributes,
@@ -359,7 +359,7 @@ module Projects::Copy
end
def work_package_version(source_work_package)
- source_work_package.fixed_version && versions.detect { |v| v.name == source_work_package.fixed_version.name }
+ source_work_package.version && versions.detect { |v| v.name == source_work_package.version.name }
end
def work_package_assigned_to(source_work_package)
diff --git a/app/models/queries/work_packages/columns/property_column.rb b/app/models/queries/work_packages/columns/property_column.rb
index f2ef20935df..0482ff3d84f 100644
--- a/app/models/queries/work_packages/columns/property_column.rb
+++ b/app/models/queries/work_packages/columns/property_column.rb
@@ -95,12 +95,12 @@ class Queries::WorkPackages::Columns::PropertyColumn < Queries::WorkPackages::Co
sortable: "name",
groupable: "#{WorkPackage.table_name}.category_id"
},
- fixed_version: {
- association: 'fixed_version',
+ version: {
+ association: 'version',
sortable: [->(table_name = Version.table_name) { Versions::Scopes::OrderBySemverName.semver_sql(table_name) }, 'name'],
default_order: 'ASC',
null_handling: 'NULLS LAST',
- groupable: "#{WorkPackage.table_name}.fixed_version_id"
+ groupable: "#{WorkPackage.table_name}.version_id"
},
start_date: {
sortable: "#{WorkPackage.table_name}.start_date",
diff --git a/app/models/queries/work_packages/filter/version_filter.rb b/app/models/queries/work_packages/filter/version_filter.rb
index c9adc2c7feb..1290d7fbdd3 100644
--- a/app/models/queries/work_packages/filter/version_filter.rb
+++ b/app/models/queries/work_packages/filter/version_filter.rb
@@ -42,11 +42,11 @@ class Queries::WorkPackages::Filter::VersionFilter <
end
def human_name
- WorkPackage.human_attribute_name('fixed_version')
+ WorkPackage.human_attribute_name('version')
end
def self.key
- :fixed_version_id
+ :version_id
end
def ar_object_filter?
diff --git a/app/models/version.rb b/app/models/version.rb
index 991d2519712..09d8bf86065 100644
--- a/app/models/version.rb
+++ b/app/models/version.rb
@@ -33,8 +33,7 @@ class Version < ActiveRecord::Base
include ::Scopes::Scoped
belongs_to :project
- has_many :fixed_issues, class_name: 'WorkPackage', foreign_key: 'fixed_version_id', dependent: :nullify
- has_many :work_packages, foreign_key: :fixed_version_id
+ has_many :work_packages, foreign_key: :version_id, dependent: :nullify
acts_as_customizable
VERSION_STATUSES = %w(open locked closed).freeze
@@ -77,14 +76,14 @@ class Version < ActiveRecord::Base
# Returns the total estimated time for this version
# (sum of leaves estimated_hours)
def estimated_hours
- @estimated_hours ||= fixed_issues.hierarchy_leaves.sum(:estimated_hours).to_f
+ @estimated_hours ||= work_packages.hierarchy_leaves.sum(:estimated_hours).to_f
end
# Returns the total reported time for this version
def spent_hours
@spent_hours ||= TimeEntry
.includes(:work_package)
- .where(work_packages: { fixed_version_id: id })
+ .where(work_packages: { version_id: id })
.sum(:hours)
.to_f
end
@@ -141,7 +140,7 @@ class Version < ActiveRecord::Base
# Returns assigned issues count
def issues_count
- @issue_count ||= fixed_issues.count
+ @issue_count ||= work_packages.count
end
# Returns the total amount of open issues for this version.
@@ -198,7 +197,7 @@ class Version < ActiveRecord::Base
# Used to weight unestimated issues in progress calculation
def estimated_average
if @estimated_average.nil?
- average = fixed_issues.average(:estimated_hours).to_f
+ average = work_packages.average(:estimated_hours).to_f
if average.zero?
average = 1
end
@@ -224,7 +223,7 @@ class Version < ActiveRecord::Base
["COALESCE(#{WorkPackage.table_name}.estimated_hours, ?) * #{ratio}", estimated_average]
)
- done = fixed_issues
+ done = work_packages
.where(statuses: { is_closed: !open })
.includes(:status)
.sum(sum_sql)
diff --git a/app/models/work_package.rb b/app/models/work_package.rb
index 6c4cbd854f8..8139e53d54e 100644
--- a/app/models/work_package.rb
+++ b/app/models/work_package.rb
@@ -43,8 +43,6 @@ class WorkPackage < ActiveRecord::Base
include OpenProject::Journal::AttachmentHelper
DONE_RATIO_OPTIONS = %w(field status disabled).freeze
- ATTRIBS_WITH_VALUES_FROM_CHILDREN =
- %w(start_date due_date estimated_hours done_ratio).freeze
belongs_to :project
belongs_to :type
@@ -52,7 +50,7 @@ class WorkPackage < ActiveRecord::Base
belongs_to :author, class_name: 'User', foreign_key: 'author_id'
belongs_to :assigned_to, class_name: 'Principal', foreign_key: 'assigned_to_id'
belongs_to :responsible, class_name: 'Principal', foreign_key: 'responsible_id'
- belongs_to :fixed_version, class_name: 'Version', foreign_key: 'fixed_version_id'
+ belongs_to :version
belongs_to :priority, class_name: 'IssuePriority', foreign_key: 'priority_id'
belongs_to :category, class_name: 'Category', foreign_key: 'category_id'
@@ -104,7 +102,7 @@ class WorkPackage < ActiveRecord::Base
}
scope :without_version, -> {
- where(fixed_version_id: nil)
+ where(version_id: nil)
}
scope :with_query, ->(query) {
@@ -264,7 +262,7 @@ class WorkPackage < ActiveRecord::Base
# (to make sure, that you can still update closed tickets)
def assignable_versions
@assignable_versions ||= begin
- current_version = fixed_version_id_changed? ? Version.find_by(id: fixed_version_id_was) : fixed_version
+ current_version = version_id_changed? ? Version.find_by(id: version_id_was) : version
((project&.assignable_versions || []) + [current_version]).compact.uniq
end
end
@@ -432,7 +430,7 @@ class WorkPackage < ActiveRecord::Base
# Unassigns issues from +version+ if it's no longer shared with issue's project
def self.update_versions_from_sharing_change(version)
# Update issues assigned to the version
- update_versions(["#{WorkPackage.table_name}.fixed_version_id = ?", version.id])
+ update_versions(["#{WorkPackage.table_name}.version_id = ?", version.id])
end
# Unassigns issues from versions that are no longer shared
@@ -456,7 +454,7 @@ class WorkPackage < ActiveRecord::Base
def self.by_version(project)
count_and_group_by project: project,
- field: 'fixed_version_id',
+ field: 'version_id',
joins: Version.table_name
end
@@ -641,28 +639,28 @@ class WorkPackage < ActiveRecord::Base
default_id && attributes.except(key).values.all?(&:blank?)
end
- def self.having_fixed_version_from_other_project
+ def self.having_version_from_other_project
where(
- "#{WorkPackage.table_name}.fixed_version_id IS NOT NULL" +
+ "#{WorkPackage.table_name}.version_id IS NOT NULL" +
" AND #{WorkPackage.table_name}.project_id <> #{Version.table_name}.project_id" +
" AND #{Version.table_name}.sharing <> 'system'"
)
end
- private_class_method :having_fixed_version_from_other_project
+ private_class_method :having_version_from_other_project
# Update issues so their versions are not pointing to a
- # fixed_version that is not shared with the issue's project
+ # version that is not shared with the issue's project
def self.update_versions(conditions = nil)
- # Only need to update issues with a fixed_version from
+ # Only need to update issues with a version from
# a different project and that is not systemwide shared
- having_fixed_version_from_other_project
+ having_version_from_other_project
.where(conditions)
- .includes(:project, :fixed_version)
+ .includes(:project, :version)
.references(:versions).each do |issue|
- next if issue.project.nil? || issue.fixed_version.nil?
+ next if issue.project.nil? || issue.version.nil?
- unless issue.project.shared_versions.include?(issue.fixed_version)
- issue.fixed_version = nil
+ unless issue.project.shared_versions.include?(issue.version)
+ issue.version = nil
issue.save
end
end
diff --git a/app/models/work_package/journalized.rb b/app/models/work_package/journalized.rb
index e8eab57677e..b234c590b0d 100644
--- a/app/models/work_package/journalized.rb
+++ b/app/models/work_package/journalized.rb
@@ -91,7 +91,7 @@ module WorkPackage::Journalized
register_on_journal_formatter :named_association, :parent_id, :project_id,
:status_id, :type_id,
:assigned_to_id, :priority_id,
- :category_id, :fixed_version_id,
+ :category_id, :version_id,
:planning_element_status_id,
:author_id, :responsible_id
register_on_journal_formatter :datetime, :start_date, :due_date
diff --git a/app/models/work_package/validations.rb b/app/models/work_package/validations.rb
index f78e4e19b9d..3af37943b9a 100644
--- a/app/models/work_package/validations.rb
+++ b/app/models/work_package/validations.rb
@@ -50,7 +50,7 @@ module WorkPackage::Validations
:status,
:author,
:category,
- :fixed_version)
+ :version)
}
end
end
diff --git a/app/seeders/demo_data/query_builder.rb b/app/seeders/demo_data/query_builder.rb
index 121fe70ca4b..53c8eb10994 100644
--- a/app/seeders/demo_data/query_builder.rb
+++ b/app/seeders/demo_data/query_builder.rb
@@ -136,7 +136,7 @@ module DemoData
def set_version_filter!(filters)
if version = config[:version].presence
- filters[:fixed_version_id] = {
+ filters[:version_id] = {
operator: "=",
values: [Version.find_by(name: version).id]
}
diff --git a/app/seeders/demo_data/work_package_seeder.rb b/app/seeders/demo_data/work_package_seeder.rb
index b8d3f6dfa14..44ce5b70d47 100644
--- a/app/seeders/demo_data/work_package_seeder.rb
+++ b/app/seeders/demo_data/work_package_seeder.rb
@@ -138,7 +138,7 @@ module DemoData
def set_version!(wp_attr, attributes)
if attributes[:version]
- wp_attr[:fixed_version] = Version.find_by!(name: attributes[:version])
+ wp_attr[:version] = Version.find_by!(name: attributes[:version])
end
end
diff --git a/app/services/reports/version_report.rb b/app/services/reports/version_report.rb
index ab5195808b8..8dd498c667a 100644
--- a/app/services/reports/version_report.rb
+++ b/app/services/reports/version_report.rb
@@ -33,7 +33,7 @@ class Reports::VersionReport < Reports::Report
end
def field
- @field ||= 'fixed_version_id'
+ @field ||= 'version_id'
end
def rows
diff --git a/app/services/versions/update_service.rb b/app/services/versions/update_service.rb
index 88819c935cf..825479e5094 100644
--- a/app/services/versions/update_service.rb
+++ b/app/services/versions/update_service.rb
@@ -38,7 +38,7 @@ module Versions
service_call
end
- # Update the issue's fixed versions. Used if a version's sharing changes.
+ # Update the issue's versions. Used if a version's sharing changes.
def update_wps_from_sharing_change
if no_valid_version_before_or_now? ||
sharing_now_less_broad?
diff --git a/app/services/work_packages/set_attributes_service.rb b/app/services/work_packages/set_attributes_service.rb
index fd43c3c61f1..95bfe647db2 100644
--- a/app/services/work_packages/set_attributes_service.rb
+++ b/app/services/work_packages/set_attributes_service.rb
@@ -131,7 +131,7 @@ class WorkPackages::SetAttributesService < ::BaseServices::SetAttributes
return unless work_package.project_id_changed? && work_package.project_id
change_by_system do
- set_fixed_version_to_nil
+ set_version_to_nil
reassign_category
reassign_type unless work_package.type_id_changed?
@@ -149,11 +149,11 @@ class WorkPackages::SetAttributesService < ::BaseServices::SetAttributes
end
end
- def set_fixed_version_to_nil
- if work_package.fixed_version &&
+ def set_version_to_nil
+ if work_package.version &&
!(work_package.project &&
- work_package.project.shared_versions.include?(work_package.fixed_version))
- work_package.fixed_version = nil
+ work_package.project.shared_versions.include?(work_package.version))
+ work_package.version = nil
end
end
diff --git a/app/views/user_mailer/_issue_details.html.erb b/app/views/user_mailer/_issue_details.html.erb
index 628721f3bb1..7b840ec6cf8 100644
--- a/app/views/user_mailer/_issue_details.html.erb
+++ b/app/views/user_mailer/_issue_details.html.erb
@@ -36,7 +36,7 @@ See docs/COPYRIGHT.rdoc for more details.
<li><%= WorkPackage.human_attribute_name(:assigned_to) %>: <%= issue.assigned_to %></li>
<li><%= WorkPackage.human_attribute_name(:responsible) %>: <%= issue.responsible %></li>
<li><%= WorkPackage.human_attribute_name(:category) %>: <%= issue.category %></li>
- <li><%= WorkPackage.human_attribute_name(:fixed_version) %>: <%= issue.fixed_version %></li>
+ <li><%= WorkPackage.human_attribute_name(:version) %>: <%= issue.version %></li>
<li><%= WorkPackage.human_attribute_name(:start_date) %>: <%= issue.start_date %></li>
<li><%= WorkPackage.human_attribute_name(:due_date) %>: <%= issue.due_date %></li>
<li><%= WorkPackage.human_attribute_name(:estimated_hours)%>: <%= issue.estimated_hours %></li>
diff --git a/app/views/user_mailer/_issue_details.text.erb b/app/views/user_mailer/_issue_details.text.erb
index 4a6e5e5c9b7..ff0a6cd61c4 100644
--- a/app/views/user_mailer/_issue_details.text.erb
+++ b/app/views/user_mailer/_issue_details.text.erb
@@ -36,7 +36,7 @@ See docs/COPYRIGHT.rdoc for more details.
<%= WorkPackage.human_attribute_name(:assigned_to) %>: <%= issue.assigned_to %>
<%= WorkPackage.human_attribute_name(:responsible) %>: <%= issue.responsible %>
<%= WorkPackage.human_attribute_name(:category) %>: <%= issue.category %>
-<%= WorkPackage.human_attribute_name(:fixed_version) %>: <%= issue.fixed_version %>
+<%= WorkPackage.human_attribute_name(:version) %>: <%= issue.version %>
<%= WorkPackage.human_attribute_name(:start_date) %>: <%= issue.start_date %>
<%= WorkPackage.human_attribute_name(:due_date) %>: <%= issue.due_date %>
<%= WorkPackage.human_attribute_name(:estimated_hours)%>: <%= issue.estimated_hours %>
diff --git a/app/views/versions/_overview.html.erb b/app/views/versions/_overview.html.erb
index d4d62727761..3a297b43b35 100644
--- a/app/views/versions/_overview.html.erb
+++ b/app/views/versions/_overview.html.erb
@@ -50,18 +50,18 @@ See docs/COPYRIGHT.rdoc for more details.
<% end %>
</ul>
-<% if version.fixed_issues.count > 0 %>
+<% if version.work_packages.count > 0 %>
<%= progress_bar([version.closed_percent, version.completed_percent], width: '40%', legend: ('%0.0f' % version.completed_percent)) %>
<p class="progress-info">
<%= link_to_if(version.closed_issues_count > 0,
l(:label_x_closed_work_packages_abbr, count: version.closed_issues_count),
project_work_packages_closed_version_path(version)) %>
- (<%= '%0.0f' % (version.closed_issues_count.to_f / version.fixed_issues.count * 100) %>%)
+ (<%= '%0.0f' % (version.closed_issues_count.to_f / version.work_packages.count * 100) %>%)
&#160;
<%= link_to_if(version.open_issues_count > 0,
l(:label_x_open_work_packages_abbr, count: version.open_issues_count),
project_work_packages_open_version_path(version)) %>
- (<%= '%0.0f' % (version.open_issues_count.to_f / version.fixed_issues.count * 100) %>%)
+ (<%= '%0.0f' % (version.open_issues_count.to_f / version.work_packages.count * 100) %>%)
</p>
<% else %>
<%= no_results_box %>
diff --git a/app/views/versions/create.js.erb b/app/views/versions/create.js.erb
index c8ee49c40e4..3f977902b9c 100644
--- a/app/views/versions/create.js.erb
+++ b/app/views/versions/create.js.erb
@@ -27,4 +27,4 @@ See docs/COPYRIGHT.rdoc for more details.
++#%>
-jQuery('#work_package_fixed_version_id').empty().append("<%= escape_javascript(version_options_for_select(versions, version)) %>");
+jQuery('#work_package_version_id').empty().append("<%= escape_javascript(version_options_for_select(versions, version)) %>");
diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erb
index 7aef6a9f00f..396b49d473b 100644
--- a/app/views/versions/show.html.erb
+++ b/app/views/versions/show.html.erb
@@ -95,7 +95,7 @@ See docs/COPYRIGHT.rdoc for more details.
</div>
<% end %>
- <% if @version.fixed_issues.count > 0 %>
+ <% if @version.work_packages.count > 0 %>
<div class="widget-box -thin -wider">
<wp-overview-graph
additional-filter='{ "version": { "operator": "=", "values": [<%= @version.id %>] }}'>
diff --git a/app/views/work_packages/bulk/edit.html.erb b/app/views/work_packages/bulk/edit.html.erb
index 44266ceaaaa..0ddb5abf9e6 100644
--- a/app/views/work_packages/bulk/edit.html.erb
+++ b/app/views/work_packages/bulk/edit.html.erb
@@ -124,9 +124,9 @@ See docs/COPYRIGHT.rdoc for more details.
<% #TODO: allow editing versions when multiple projects %>
<% if @project %>
<div class="form--field">
- <label class="form--label" for='work_package_fixed_version_id'><%= WorkPackage.human_attribute_name(:fixed_version) %></label>
+ <label class="form--label" for='work_package_version_id'><%= WorkPackage.human_attribute_name(:version) %></label>
<div class="form--field-container">
- <%= styled_select_tag('work_package[fixed_version_id]', content_tag('option', l(:label_no_change_option), value: '') +
+ <%= styled_select_tag('work_package[version_id]', content_tag('option', l(:label_no_change_option), value: '') +
content_tag('option', l(:label_none), value: 'none') +
version_options_for_select(@project.shared_versions.with_status_open.order_by_semver_name)) %>
</div>
diff --git a/app/views/work_packages/moves/new.html.erb b/app/views/work_packages/moves/new.html.erb
index ca479facd66..f4dc97c2b13 100644
--- a/app/views/work_packages/moves/new.html.erb
+++ b/app/views/work_packages/moves/new.html.erb
@@ -80,9 +80,9 @@ See docs/COPYRIGHT.rdoc for more details.
</div>
</div>
<div class="form--field">
- <label class="form--label" for='fixed_version_id'><%= WorkPackage.human_attribute_name(:version) %></label>
+ <label class="form--label" for='version_id'><%= WorkPackage.human_attribute_name(:version) %></label>
<div class="form--field-container">
- <%= styled_select_tag('fixed_version_id',
+ <%= styled_select_tag('version_id',
content_tag('option', l(:label_no_change_option), value: '') +
version_options_for_select(@available_versions)) %>
</div>
diff --git a/config/constants/ar_to_api_conversions.rb b/config/constants/ar_to_api_conversions.rb
index 2563b36c80e..658f3f46905 100644
--- a/config/constants/ar_to_api_conversions.rb
+++ b/config/constants/ar_to_api_conversions.rb
@@ -30,7 +30,7 @@ module Constants
class ARToAPIConversions
WELL_KNOWN_CONVERSIONS = {
assigned_to: 'assignee',
- fixed_version: 'version',
+ version: 'version',
done_ratio: 'percentageDone',
estimated_hours: 'estimatedTime',
created_on: 'createdAt',
diff --git a/config/locales/crowdin/ar.yml b/config/locales/crowdin/ar.yml
index 20c541a9806..f2631918592 100644
--- a/config/locales/crowdin/ar.yml
+++ b/config/locales/crowdin/ar.yml
@@ -468,7 +468,7 @@ ar:
done_ratio: "التقدم (%)"
end_insertion: "نهاية الإدراج"
end_deletion: "نهاية الحذف"
- fixed_version: "الإصدار"
+ version: "الإصدار"
parent: "الجذر"
parent_issue: "الجذر"
parent_work_package: "الجذر"
diff --git a/config/locales/crowdin/bg.yml b/config/locales/crowdin/bg.yml
index 9747c0d10a1..207061b2908 100644
--- a/config/locales/crowdin/bg.yml
+++ b/config/locales/crowdin/bg.yml
@@ -464,7 +464,7 @@ bg:
done_ratio: "Прогрес (%)"
end_insertion: "Край на вмъкване"
end_deletion: "Края на изтриване"
- fixed_version: "Версия"
+ version: "Версия"
parent: "Горна категория"
parent_issue: "Горна категория"
parent_work_package: "Горна категория"
diff --git a/config/locales/crowdin/ca.yml b/config/locales/crowdin/ca.yml
index 7f159ea2d6f..463294921d3 100644
--- a/config/locales/crowdin/ca.yml
+++ b/config/locales/crowdin/ca.yml
@@ -464,7 +464,7 @@ ca:
done_ratio: "Progrés (%)"
end_insertion: "Final de la inserció"
end_deletion: "Final de la supressió"
- fixed_version: "Versió"
+ version: "Versió"
parent: "Pare"
parent_issue: "Pare"
parent_work_package: "Pare"
diff --git a/config/locales/crowdin/cs.yml b/config/locales/crowdin/cs.yml
index 7feb2e90a0b..bff0ebc4b3b 100644
--- a/config/locales/crowdin/cs.yml
+++ b/config/locales/crowdin/cs.yml
@@ -466,7 +466,7 @@ cs:
done_ratio: "Průběh (%)"
end_insertion: "Konec vložení"
end_deletion: "Konec odstranění"
- fixed_version: "Verze"
+ version: "Verze"
parent: "Rodič"
parent_issue: "Rodič"
parent_work_package: "Rodič"
diff --git a/config/locales/crowdin/da.yml b/config/locales/crowdin/da.yml
index 3a8af303984..ee22c43dfab 100644
--- a/config/locales/crowdin/da.yml
+++ b/config/locales/crowdin/da.yml
@@ -464,7 +464,7 @@ da:
done_ratio: "Fremskridt (%)"
end_insertion: "End of the insertion"
end_deletion: "End of the deletion"
- fixed_version: "Version"
+ version: "Version"
parent: "Overordnet"
parent_issue: "Overordnet"
parent_work_package: "Overordnet"
diff --git a/config/locales/crowdin/de.yml b/config/locales/crowdin/de.yml
index 8914a187f9a..9f2c9736c74 100644
--- a/config/locales/crowdin/de.yml
+++ b/config/locales/crowdin/de.yml
@@ -460,7 +460,7 @@ de:
done_ratio: "Fortschritt (%)"
end_insertion: "Ende der Einfügung"
end_deletion: "Ende des Löschvorgangs"
- fixed_version: "Version"
+ version: "Version"
parent: "Übergeordnetes Arbeitspaket"
parent_issue: "Übergeordnetes Arbeitspaket"
parent_work_package: "Übergeordnetes Arbeitspaket"
diff --git a/config/locales/crowdin/el.yml b/config/locales/crowdin/el.yml
index 5ae3d11e553..0fd980c08e6 100644
--- a/config/locales/crowdin/el.yml
+++ b/config/locales/crowdin/el.yml
@@ -461,7 +461,7 @@ el:
done_ratio: "Πρόοδος (%)"
end_insertion: "Λήξη της εισαγωγής"
end_deletion: "Λήξη της διαγραφής"
- fixed_version: "Έκδοση"
+ version: "Έκδοση"
parent: "Γονέας"
parent_issue: "Γονέας"
parent_work_package: "Γονέας"
diff --git a/config/locales/crowdin/es.yml b/config/locales/crowdin/es.yml
index 8cbd06d438d..3e2f13d3ce2 100644
--- a/config/locales/crowdin/es.yml
+++ b/config/locales/crowdin/es.yml
@@ -461,7 +461,7 @@ es:
done_ratio: "Progreso (%)"
end_insertion: "Final de la inserción"
end_deletion: "Final de la eliminación"
- fixed_version: "Versión"
+ version: "Versión"
parent: "Padre"
parent_issue: "Padre"
parent_work_package: "Padre"
diff --git a/config/locales/crowdin/fi.yml b/config/locales/crowdin/fi.yml
index 7772b351517..61ff5b0ac98 100644
--- a/config/locales/crowdin/fi.yml
+++ b/config/locales/crowdin/fi.yml
@@ -464,7 +464,7 @@ fi:
done_ratio: "Edistyminen (%)"
end_insertion: "Lisäyksen loppu"
end_deletion: "Poistokohdan loppu"
- fixed_version: "Versio"
+ version: "Versio"
parent: "Ylätaso"
parent_issue: "Ylätaso"
parent_work_package: "Ylätaso"
diff --git a/config/locales/crowdin/fil.yml b/config/locales/crowdin/fil.yml
index fc740fb8891..f6f665cd653 100644
--- a/config/locales/crowdin/fil.yml
+++ b/config/locales/crowdin/fil.yml
@@ -464,7 +464,7 @@ fil:
done_ratio: "Isinasagawa (%)"
end_insertion: "Katapusan na"
end_deletion: "Katapusan ng pagbubura"
- fixed_version: "Bersyon"
+ version: "Bersyon"
parent: "Magulang"
parent_issue: "Magulang"
parent_work_package: "Magulang"
diff --git a/config/locales/crowdin/fr.yml b/config/locales/crowdin/fr.yml
index 05bafa6658d..9bd2358e1b5 100644
--- a/config/locales/crowdin/fr.yml
+++ b/config/locales/crowdin/fr.yml
@@ -463,7 +463,7 @@ fr:
done_ratio: "Progrès (%)"
end_insertion: "Fin de l’insertion"
end_deletion: "Fin de la suppression"
- fixed_version: "Version"
+ version: "Version"
parent: "Parent"
parent_issue: "Parent"
parent_work_package: "Parent"
diff --git a/config/locales/crowdin/hr.yml b/config/locales/crowdin/hr.yml
index e2ab013bc83..0017208a4a2 100644
--- a/config/locales/crowdin/hr.yml
+++ b/config/locales/crowdin/hr.yml
@@ -465,7 +465,7 @@ hr:
done_ratio: "Napredak (%)"
end_insertion: "Kraj umetanja"
end_deletion: "Kraj brisanja"
- fixed_version: "Verzija"
+ version: "Verzija"
parent: "Matični"
parent_issue: "Matični"
parent_work_package: "Matični"
diff --git a/config/locales/crowdin/hu.yml b/config/locales/crowdin/hu.yml
index beff7a6dbf4..8cd2c8125a8 100644
--- a/config/locales/crowdin/hu.yml
+++ b/config/locales/crowdin/hu.yml
@@ -461,7 +461,7 @@ hu:
done_ratio: "Folyamat állapot (%)"
end_insertion: "Beillesztés vége"
end_deletion: "Törlés vége"
- fixed_version: "Verzió"
+ version: "Verzió"
parent: "Szülő"
parent_issue: "Szülő"
parent_work_package: "Szülő"
diff --git a/config/locales/crowdin/id.yml b/config/locales/crowdin/id.yml
index ea9c901e1c6..04e508cb161 100644
--- a/config/locales/crowdin/id.yml
+++ b/config/locales/crowdin/id.yml
@@ -462,7 +462,7 @@ id:
done_ratio: "Progress (%)"
end_insertion: "End of the insertion"
end_deletion: "End of the deletion"
- fixed_version: "Versi"
+ version: "Versi"
parent: "Induk"
parent_issue: "Induk"
parent_work_package: "Induk"
diff --git a/config/locales/crowdin/it.yml b/config/locales/crowdin/it.yml
index 3c59b64ef87..08c02aa9a57 100644
--- a/config/locales/crowdin/it.yml
+++ b/config/locales/crowdin/it.yml
@@ -460,7 +460,7 @@ it:
done_ratio: "Avanzamento (%)"
end_insertion: "Fine inserimento"
end_deletion: "Fine cancellazione"
- fixed_version: "Versione"
+ version: "Versione"
parent: "Superiore"
parent_issue: "Superiore"
parent_work_package: "Superiore"
diff --git a/config/locales/crowdin/ja.yml b/config/locales/crowdin/ja.yml
index 7920cefc8d7..3e6a3975cfc 100644
--- a/config/locales/crowdin/ja.yml
+++ b/config/locales/crowdin/ja.yml
@@ -461,7 +461,7 @@ ja:
done_ratio: "進行状況 (%)"
end_insertion: "挿入の終わり"
end_deletion: "削除の終わり"
- fixed_version: "バージョン"
+ version: "バージョン"
parent: "親項目"
parent_issue: "親項目"
parent_work_package: "親項目"
diff --git a/config/locales/crowdin/ko.yml b/config/locales/crowdin/ko.yml
index 87bf5318b2c..738774af8a6 100644
--- a/config/locales/crowdin/ko.yml
+++ b/config/locales/crowdin/ko.yml
@@ -462,7 +462,7 @@ ko:
done_ratio: "진행률 (%)"
end_insertion: "삽입 끝"
end_deletion: "삭제 끝"
- fixed_version: "버전"
+ version: "버전"
parent: "부모"
parent_issue: "부모"
parent_work_package: "부모"
diff --git a/config/locales/crowdin/lt.yml b/config/locales/crowdin/lt.yml
index db080b00a6c..0881cab6460 100644
--- a/config/locales/crowdin/lt.yml
+++ b/config/locales/crowdin/lt.yml
@@ -463,7 +463,7 @@ lt:
done_ratio: "Progresas (%)"
end_insertion: "Įterpimo pabaigoje"
end_deletion: "Ištrynimo pabaigoje"
- fixed_version: "Versija"
+ version: "Versija"
parent: "Tėvas"
parent_issue: "Tėvas"
parent_work_package: "Tėvas"
diff --git a/config/locales/crowdin/nl.yml b/config/locales/crowdin/nl.yml
index 9ddc758d127..1ee3d86ead8 100644
--- a/config/locales/crowdin/nl.yml
+++ b/config/locales/crowdin/nl.yml
@@ -464,7 +464,7 @@ nl:
done_ratio: "Voortgang (%)"
end_insertion: "Einde van het invoegen"
end_deletion: "Einde van de verwijdering"
- fixed_version: "Versie"
+ version: "Versie"
parent: "Bovenliggend werkpakket"
parent_issue: "Bovenliggend werkpakket"
parent_work_package: "Bovenliggend werkpakket"
diff --git a/config/locales/crowdin/no.yml b/config/locales/crowdin/no.yml
index 35bf7c097e1..4aaa18834a6 100644
--- a/config/locales/crowdin/no.yml
+++ b/config/locales/crowdin/no.yml
@@ -464,7 +464,7 @@
done_ratio: "Progress (%)"
end_insertion: "End of the insertion"
end_deletion: "End of the deletion"
- fixed_version: "Versjon"
+ version: "Versjon"
parent: "Overordnet"
parent_issue: "Overordnet"
parent_work_package: "Overordnet"
diff --git a/config/locales/crowdin/pl.yml b/config/locales/crowdin/pl.yml
index fb156e3cee2..c55e50c9fc7 100644
--- a/config/locales/crowdin/pl.yml
+++ b/config/locales/crowdin/pl.yml
@@ -464,7 +464,7 @@ pl:
done_ratio: "Postęp (%)"
end_insertion: "Koniec wstawiania"
end_deletion: "Koniec usuwania"
- fixed_version: "Wersja"
+ version: "Wersja"
parent: "Rodzic"
parent_issue: "Rodzic"
parent_work_package: "Rodzic"
diff --git a/config/locales/crowdin/pt-BR.yml b/config/locales/crowdin/pt-BR.yml
index 16f3fe5689c..1b0372557c7 100644
--- a/config/locales/crowdin/pt-BR.yml
+++ b/config/locales/crowdin/pt-BR.yml
@@ -463,7 +463,7 @@ pt-BR:
done_ratio: "Progresso (%)"
end_insertion: "Final da inserção"
end_deletion: "Final da exclusão"
- fixed_version: "Versão"
+ version: "Versão"
parent: "Pai"
parent_issue: "Pai"
parent_work_package: "Pai"
diff --git a/config/locales/crowdin/pt.yml b/config/locales/crowdin/pt.yml
index 82af06eaf12..6c0006c5a93 100644
--- a/config/locales/crowdin/pt.yml
+++ b/config/locales/crowdin/pt.yml
@@ -462,7 +462,7 @@ pt:
done_ratio: "Progresso (%)"
end_insertion: "Final da inserção"
end_deletion: "Final da exclusão"
- fixed_version: "Versão"
+ version: "Versão"
parent: "Mãe"
parent_issue: "Mãe"
parent_work_package: "Mãe"
diff --git a/config/locales/crowdin/ro.yml b/config/locales/crowdin/ro.yml
index 784dd6d4196..7a77f7f9546 100644
--- a/config/locales/crowdin/ro.yml
+++ b/config/locales/crowdin/ro.yml
@@ -465,7 +465,7 @@ ro:
done_ratio: "Progres (%)"
end_insertion: "Sfârșit de inserare"
end_deletion: "Sfârșit de ștergere"
- fixed_version: "Versiune"
+ version: "Versiune"
parent: "Părinte"
parent_issue: "Părinte"
parent_work_package: "Părinte"
diff --git a/config/locales/crowdin/ru.yml b/config/locales/crowdin/ru.yml
index 7b28dcb8a69..9603a8133f8 100644
--- a/config/locales/crowdin/ru.yml
+++ b/config/locales/crowdin/ru.yml
@@ -465,7 +465,7 @@ ru:
done_ratio: "Прогресс (%)"
end_insertion: "Завершение вставки"
end_deletion: "Завершение удаления"
- fixed_version: "Стадия"
+ version: "Стадия"
parent: "Родитель"
parent_issue: "Родитель"
parent_work_package: "Родитель"
diff --git a/config/locales/crowdin/sk.yml b/config/locales/crowdin/sk.yml
index d4caec6bd96..fa949bcaa09 100644
--- a/config/locales/crowdin/sk.yml
+++ b/config/locales/crowdin/sk.yml
@@ -466,7 +466,7 @@ sk:
done_ratio: "Stav spracovania (%)"
end_insertion: "Koniec vkladania"
end_deletion: "Koniec odstraňovania"
- fixed_version: "Verzia"
+ version: "Verzia"
parent: "Nadradený balíček"
parent_issue: "Nadradený balíček"
parent_work_package: "Nadradený balíček"
diff --git a/config/locales/crowdin/sv.yml b/config/locales/crowdin/sv.yml
index 00cf1a971cb..a461ea8f517 100644
--- a/config/locales/crowdin/sv.yml
+++ b/config/locales/crowdin/sv.yml
@@ -463,7 +463,7 @@ sv:
done_ratio: "Progress (%)"
end_insertion: "Slutet av införandet"
end_deletion: "Slutet av raderingen"
- fixed_version: "Version"
+ version: "Version"
parent: "Överordnad"
parent_issue: "Överordnad"
parent_work_package: "Överordnad"
diff --git a/config/locales/crowdin/tr.yml b/config/locales/crowdin/tr.yml
index ef2f8986b81..fd7a35330dd 100644
--- a/config/locales/crowdin/tr.yml
+++ b/config/locales/crowdin/tr.yml
@@ -464,7 +464,7 @@ tr:
done_ratio: "İlerleme (%)"
end_insertion: "Ekleme işlemi bitti"
end_deletion: "Silme işlemi bitti"
- fixed_version: "Sürüm"
+ version: "Sürüm"
parent: "Üst"
parent_issue: "Üst"
parent_work_package: "Üst"
diff --git a/config/locales/crowdin/uk.yml b/config/locales/crowdin/uk.yml
index 93d6fcf3ca7..e80e36aeda8 100644
--- a/config/locales/crowdin/uk.yml
+++ b/config/locales/crowdin/uk.yml
@@ -466,7 +466,7 @@ uk:
done_ratio: "Прогрес (%)"
end_insertion: "Кінець вставки"
end_deletion: "Кінець видалення"
- fixed_version: "Версія"
+ version: "Версія"
parent: "Джерело"
parent_issue: "Джерело"
parent_work_package: "Джерело"
diff --git a/config/locales/crowdin/vi.yml b/config/locales/crowdin/vi.yml
index 1285f3791ed..2ecf1fd69a5 100644
--- a/config/locales/crowdin/vi.yml
+++ b/config/locales/crowdin/vi.yml
@@ -465,7 +465,7 @@ vi:
done_ratio: "Progress (%)"
end_insertion: "End of the insertion"
end_deletion: "End of the deletion"
- fixed_version: "Phiên bản"
+ version: "Phiên bản"
parent: "Cha"
parent_issue: "Cha"
parent_work_package: "Cha"
diff --git a/config/locales/crowdin/zh-CN.yml b/config/locales/crowdin/zh-CN.yml
index b1150a53970..a04934c766d 100644
--- a/config/locales/crowdin/zh-CN.yml
+++ b/config/locales/crowdin/zh-CN.yml
@@ -460,7 +460,7 @@ zh-CN:
done_ratio: "进度 (%)"
end_insertion: "结束插入"
end_deletion: "结束删除"
- fixed_version: "版本"
+ version: "版本"
parent: "父"
parent_issue: "父"
parent_work_package: "父"
diff --git a/config/locales/crowdin/zh-TW.yml b/config/locales/crowdin/zh-TW.yml
index ed4c431c40a..7364404a098 100644
--- a/config/locales/crowdin/zh-TW.yml
+++ b/config/locales/crowdin/zh-TW.yml
@@ -463,7 +463,7 @@ zh-TW:
done_ratio: "進度 (%)"
end_insertion: "結束插入"
end_deletion: "結束刪除"
- fixed_version: "版本"
+ version: "版本"
parent: "上層目錄:"
parent_issue: "上層目錄:"
parent_work_package: "上層目錄:"
diff --git a/config/locales/en.yml b/config/locales/en.yml
index be0a64aa126..5b341a5ba8e 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -514,7 +514,7 @@ en:
done_ratio: "Progress (%)"
end_insertion: "End of the insertion"
end_deletion: "End of the deletion"
- fixed_version: "Version"
+ version: "Version"
parent: "Parent"
parent_issue: "Parent"
parent_work_package: "Parent"
diff --git a/db/migrate/20200326102408_rename_fixed_version.rb b/db/migrate/20200326102408_rename_fixed_version.rb
new file mode 100644
index 00000000000..bebce2fe726
--- /dev/null
+++ b/db/migrate/20200326102408_rename_fixed_version.rb
@@ -0,0 +1,37 @@
+class RenameFixedVersion < ActiveRecord::Migration[6.0]
+ def up
+ rename_column :work_packages, :fixed_version_id, :version_id
+ rename_column :work_package_journals, :fixed_version_id, :version_id
+
+ rename_query_attributes('fixed_version', 'version')
+ end
+
+ def down
+ rename_column :work_packages, :version_id, :fixed_version_id
+ rename_column :work_package_journals, :version_id, :fixed_version_id
+
+ rename_query_attributes('version', 'fixed_version')
+ end
+
+ def rename_query_attributes(from, to)
+ ActiveRecord::Base.connection.exec_query(
+ <<-SQL
+ UPDATE
+ queries q_sink
+ SET
+ filters = regexp_replace(q_source.filters, '(\n)#{from}_id:(\n)', '\1#{to}_id:\2'),
+ column_names = regexp_replace(q_source.column_names, ':#{from}', ':#{to}'),
+ sort_criteria = regexp_replace(q_source.sort_criteria, '#{from}', '#{to}'),
+ group_by = regexp_replace(q_source.group_by, '#{from}', '#{to}')
+ FROM
+ queries q_source
+ WHERE
+ (q_source.filters LIKE '%#{from}_id:%'
+ OR q_source.column_names LIKE '%#{from}%'
+ OR q_source.sort_criteria LIKE '%#{from}%'
+ OR q_source.group_by = '#{from}')
+ AND q_sink.id = q_source.id
+ SQL
+ )
+ end
+end
diff --git a/docs/installation-and-operations/configuration/incoming-emails/README.md b/docs/installation-and-operations/configuration/incoming-emails/README.md
index b1307a550fd..9875a4a56a0 100644
--- a/docs/installation-and-operations/configuration/incoming-emails/README.md
+++ b/docs/installation-and-operations/configuration/incoming-emails/README.md
@@ -55,7 +55,7 @@ Available arguments that change how the work packages are handled:
| `category` | name of the target category |
| `priority` | name of the target priority |
| `status` | name of the target status |
-| `fixed_version` | name of the target version |
+| `version` | name of the target version |
| `type` | name of the target type |
| `priority` | name of the target priority |
| `unknown_user`| ignore: email is ignored (default), accept: accept as anonymous user, create: create a user account |
diff --git a/features/step_definitions/issue_steps.rb b/features/step_definitions/issue_steps.rb
index 0958da99032..54eb078898d 100644
--- a/features/step_definitions/issue_steps.rb
+++ b/features/step_definitions/issue_steps.rb
@@ -116,7 +116,7 @@ Given (/^there are the following issues with attributes:$/) do |table|
attributes.merge! type_id: type.id if type
version = Version.find_by(name: attributes.delete('version'))
- attributes.merge! fixed_version_id: version.id if version
+ attributes.merge! version_id: version.id if version
category = Category.find_by(name: attributes.delete('category'))
attributes.merge! category_id: category.id if category
diff --git a/lib/api/utilities/property_name_converter.rb b/lib/api/utilities/property_name_converter.rb
index 4feda838e27..b7a9aa2d4d7 100644
--- a/lib/api/utilities/property_name_converter.rb
+++ b/lib/api/utilities/property_name_converter.rb
@@ -37,7 +37,7 @@ module API
# - APIv3 defines some properties as a different type, which requires a name change
# e.g. estimatedTime vs estimated_hours (AR: hours; API: generic duration)
# - some names used in AR are even there kind of deprecated
- # e.g. fixed_version, which everyone refers to as version
+ # e.g. version, which everyone refers to as version
# - some names in AR are plainly inconsistent, whereas the API tries to be as consistent as
# possible, e.g. updated_at vs updated_on
#
diff --git a/lib/api/v3/work_packages/eager_loading/checksum.rb b/lib/api/v3/work_packages/eager_loading/checksum.rb
index 3c1e798460c..fb5866b02c4 100644
--- a/lib/api/v3/work_packages/eager_loading/checksum.rb
+++ b/lib/api/v3/work_packages/eager_loading/checksum.rb
@@ -49,7 +49,7 @@ module API
def fetch_checksums_for(work_packages)
WorkPackage
.where(id: work_packages.map(&:id).uniq)
- .left_joins(:status, :author, :responsible, :assigned_to, :fixed_version, :priority, :category, :type)
+ .left_joins(:status, :author, :responsible, :assigned_to, :version, :priority, :category, :type)
.pluck('work_packages.id', Arel.sql(md5_concat.squish))
.to_h
end
diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rb
index d1599567d0f..caeda924233 100644
--- a/lib/api/v3/work_packages/work_package_representer.rb
+++ b/lib/api/v3/work_packages/work_package_representer.rb
@@ -435,8 +435,7 @@ module API
setter: PrincipalSetter.lambda(:assigned_to, :assignee),
link: ::API::V3::Principals::AssociatedSubclassLambda.link(:assigned_to)
- associated_resource :fixed_version,
- as: :version,
+ associated_resource :version,
v3_path: :version,
representer: ::API::V3::Versions::VersionRepresenter
diff --git a/lib/plugins/acts_as_journalized/lib/acts_as_journalized.rb b/lib/plugins/acts_as_journalized/lib/acts_as_journalized.rb
index 2de7aeb5bdc..befb8fb99af 100644
--- a/lib/plugins/acts_as_journalized/lib/acts_as_journalized.rb
+++ b/lib/plugins/acts_as_journalized/lib/acts_as_journalized.rb
@@ -80,7 +80,6 @@ module Redmine
include Users
include Reversion
include Reset
- include Reload
include Permissions
include SaveHooks
include FormatHooks
diff --git a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/reload.rb b/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/reload.rb
deleted file mode 100644
index 6ba7abe19ed..00000000000
--- a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/reload.rb
+++ /dev/null
@@ -1,88 +0,0 @@
-#-- copyright
-# OpenProject is an open source project management software.
-# Copyright (C) 2012-2020 the OpenProject GmbH
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License version 3.
-#
-# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
-# Copyright (C) 2006-2017 Jean-Philippe Lang
-# Copyright (C) 2010-2013 the ChiliProject Team
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# See docs/COPYRIGHT.rdoc for more details.
-#++
-
-#-- encoding: UTF-8
-
-# This file included as part of the acts_as_journalized plugin for
-# the redMine project management software; You can redistribute it
-# and/or modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# The original copyright and license conditions are:
-# Copyright (c) 2009 Steve Richert
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-module Redmine::Acts::Journalized
- # Ties into the existing ActiveRecord::Base#reload method to ensure that journal information
- # is properly reset.
- module Reload
- def self.included(base) # :nodoc:
- base.class_eval do
- prepend InstanceMethods
- end
- end
-
- # Adds instance methods into ActiveRecord::Base to tap into the +reload+ method.
- module InstanceMethods
- # Overrides ActiveRecord::Base#reload, resetting the instance-variable-cached journal number
- # before performing the original +reload+ method.
- def reload(*args)
- reset_journal
- super
- end
- end
- end
-end
diff --git a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/reversion.rb b/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/reversion.rb
index 8dec75587e2..074bb91a2f9 100644
--- a/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/reversion.rb
+++ b/lib/plugins/acts_as_journalized/lib/redmine/acts/journalized/reversion.rb
@@ -27,6 +27,7 @@
#++
#-- encoding: UTF-8
+
# This file included as part of the acts_as_journalized plugin for
# the redMine project management software; You can redistribute it
# and/or modify it under the terms of the GNU General Public License
@@ -75,11 +76,6 @@ module Redmine::Acts::Journalized
# Provides the base instance methods required to revert a journaled instance.
module InstanceMethods
- # Returns the current version number for the versioned object.
- def version
- @version ||= last_version
- end
-
def last_journal
journals.last
end
@@ -114,16 +110,12 @@ module Redmine::Acts::Journalized
changes_between(journal, to_number).each do |attribute, change|
write_attribute(attribute, change.last)
end
-
- reset_journal(to_number)
end
# Behaves similarly to the +revert_to+ method except that it automatically saves the record
# after the rejournal. The return value is the success of the save.
def revert_to!(value)
revert_to(value)
- reset_journal if saved = save
- saved
end
# Returns a boolean specifying whether the object has been reverted to a previous journal or
@@ -140,13 +132,6 @@ module Redmine::Acts::Journalized
def last_version
@last_version ||= journals.maximum(:version) || 0
end
-
- # Clears the cached version number instance variables so that they can be recalculated.
- # Useful after a new version is created.
- def reset_journal(version = nil)
- @last_version = nil if version.nil?
- @version = version
- end
end
end
end
diff --git a/lib/tasks/email.rake b/lib/tasks/email.rake
index 4d8d88abcf9..9cf2475c341 100644
--- a/lib/tasks/email.rake
+++ b/lib/tasks/email.rake
@@ -205,7 +205,7 @@ END_DESC
def options_from_env
{ issue: {} }.tap do |options|
default_fields = (ENV['default_fields'] || '').split
- default_fields |= %w[project status type category priority assigned_to fixed_version]
+ default_fields |= %w[project status type category priority assigned_to version]
default_fields.each do |field| options[:issue][field.to_sym] = ENV[field] if ENV[field] end
options[:allow_override] = ENV['allow_override'] if ENV['allow_override']
diff --git a/modules/backlogs/app/assets/javascripts/backlogs/impediment.js b/modules/backlogs/app/assets/javascripts/backlogs/impediment.js
index 0911d8ce9de..c456a8f49f4 100644
--- a/modules/backlogs/app/assets/javascripts/backlogs/impediment.js
+++ b/modules/backlogs/app/assets/javascripts/backlogs/impediment.js
@@ -57,7 +57,7 @@ RB.Impediment = (function ($) {
data = j.find('.editor').serialize() +
"&is_impediment=true" +
- "&fixed_version_id=" + RB.constants.sprint_id +
+ "&version_id=" + RB.constants.sprint_id +
"&status_id=" + statusID +
"&prev=" + (prev.length === 1 ? prev.data('this').getID() : '') +
(this.isNew() ? "" : "&id=" + j.children('.id').text());
diff --git a/modules/backlogs/app/assets/javascripts/backlogs/story.js b/modules/backlogs/app/assets/javascripts/backlogs/story.js
index 78f1741ff2b..86fc3d5fb5b 100644
--- a/modules/backlogs/app/assets/javascripts/backlogs/story.js
+++ b/modules/backlogs/app/assets/javascripts/backlogs/story.js
@@ -101,7 +101,7 @@ RB.Story = (function ($) {
data = "prev=" +
(prev.length === 1 ? prev.data('this').getID() : '') +
- "&fixed_version_id=" + sprintId;
+ "&version_id=" + sprintId;
if (this.$.find('.editor').length > 0) {
data += "&" + this.$.find('.editor').serialize();
diff --git a/modules/backlogs/app/assets/stylesheets/backlogs/master_backlog.sass b/modules/backlogs/app/assets/stylesheets/backlogs/master_backlog.sass
index 6796319ab5c..f9f278da4b8 100644
--- a/modules/backlogs/app/assets/stylesheets/backlogs/master_backlog.sass
+++ b/modules/backlogs/app/assets/stylesheets/backlogs/master_backlog.sass
@@ -260,7 +260,7 @@
min-height: 14px
height: 2rem
text-align: center
- .type_id .v, .id .v, .status_id .v, .fixed_version_id, .higher_item_id
+ .type_id .v, .id .v, .status_id .v, .version_id, .higher_item_id
display: none
.rb_dialog
diff --git a/modules/backlogs/app/controllers/rb_impediments_controller.rb b/modules/backlogs/app/controllers/rb_impediments_controller.rb
index 7474664ac38..92d293617f0 100644
--- a/modules/backlogs/app/controllers/rb_impediments_controller.rb
+++ b/modules/backlogs/app/controllers/rb_impediments_controller.rb
@@ -64,7 +64,7 @@ class RbImpedimentsController < RbApplicationController
params.delete(:project_id)
hash = params
- .permit(:fixed_version_id, :status_id, :id, :sprint_id,
+ .permit(:version_id, :status_id, :id, :sprint_id,
:assigned_to_id, :remaining_hours, :subject, :blocks_ids)
.to_h
.symbolize_keys
diff --git a/modules/backlogs/app/controllers/rb_queries_controller.rb b/modules/backlogs/app/controllers/rb_queries_controller.rb
index d21ea2a9b8c..d171f125490 100644
--- a/modules/backlogs/app/controllers/rb_queries_controller.rb
+++ b/modules/backlogs/app/controllers/rb_queries_controller.rb
@@ -33,11 +33,11 @@ class RbQueriesController < RbApplicationController
filters = []
if @sprint_id
filters.push(filter_object('status_id', '*'))
- filters.push(filter_object('fixed_version_id', '=', [@sprint_id]))
+ filters.push(filter_object('version_id', '=', [@sprint_id]))
# Note: We need a filter for backlogs_work_package_type but currently it's not possible for plugins to introduce new filter types
else
filters.push(filter_object('status_id', 'o'))
- filters.push(filter_object('fixed_version_id', '!*', [@sprint_id]))
+ filters.push(filter_object('version_id', '!*', [@sprint_id]))
# Same as above
end
diff --git a/modules/backlogs/app/controllers/rb_stories_controller.rb b/modules/backlogs/app/controllers/rb_stories_controller.rb
index 32d9f025224..f4ad38b04f5 100644
--- a/modules/backlogs/app/controllers/rb_stories_controller.rb
+++ b/modules/backlogs/app/controllers/rb_stories_controller.rb
@@ -32,7 +32,7 @@ class RbStoriesController < RbApplicationController
# This is a constant here because we will recruit it elsewhere to whitelist
# attributes. This is necessary for now as we still directly use `attributes=`
# in non-controller code.
- PERMITTED_PARAMS = [:id, :status_id, :fixed_version_id,
+ PERMITTED_PARAMS = [:id, :status_id, :version_id,
:story_points, :type_id, :subject, :author_id,
:sprint_id]
diff --git a/modules/backlogs/app/models/impediment.rb b/modules/backlogs/app/models/impediment.rb
index e4359041a40..b273033f24b 100644
--- a/modules/backlogs/app/models/impediment.rb
+++ b/modules/backlogs/app/models/impediment.rb
@@ -58,8 +58,8 @@ class Impediment < Task
if blocks_ids.size == 0
errors.add :blocks_ids, :must_block_at_least_one_work_package
else
- other_version_ids = WorkPackage.where(id: blocks_ids).pluck(:fixed_version_id).uniq
- errors.add :blocks_ids, :can_only_contain_work_packages_of_current_sprint if other_version_ids.size != 1 || other_version_ids[0] != fixed_version_id
+ other_version_ids = WorkPackage.where(id: blocks_ids).pluck(:version_id).uniq
+ errors.add :blocks_ids, :can_only_contain_work_packages_of_current_sprint if other_version_ids.size != 1 || other_version_ids[0] != version_id
end
end
end
diff --git a/modules/backlogs/app/models/sprint.rb b/modules/backlogs/app/models/sprint.rb
index 68d75342f8d..ca7056b0da2 100644
--- a/modules/backlogs/app/models/sprint.rb
+++ b/modules/backlogs/app/models/sprint.rb
@@ -141,7 +141,7 @@ class Sprint < Version
# Assume a sprint is active if it's only 2 days old
return true if bd.remaining_hours.size <= 2
- WorkPackage.exists?(['fixed_version_id = ? and ((updated_on between ? and ?) or (created_on between ? and ?))',
+ WorkPackage.exists?(['version_id = ? and ((updated_on between ? and ?) or (created_on between ? and ?))',
id, -2.days.from_now, Time.now, -2.days.from_now, Time.now])
end
@@ -164,6 +164,6 @@ class Sprint < Version
def impediments(project)
# for reasons beyond me,
# the default_scope needs to be explicitly applied.
- Impediment.default_scope.where(fixed_version_id: self, project_id: project)
+ Impediment.default_scope.where(version_id: self, project_id: project)
end
end
diff --git a/modules/backlogs/app/models/story.rb b/modules/backlogs/app/models/story.rb
index c7a9262ef7c..8994dac225e 100644
--- a/modules/backlogs/app/models/story.rb
+++ b/modules/backlogs/app/models/story.rb
@@ -40,12 +40,12 @@ class Story < WorkPackage
end
candidates.each do |story|
- last_rank = stories_by_version[story.fixed_version_id].size > 0 ?
- stories_by_version[story.fixed_version_id].last.rank :
+ last_rank = stories_by_version[story.version_id].size > 0 ?
+ stories_by_version[story.version_id].last.rank :
0
story.rank = last_rank + 1
- stories_by_version[story.fixed_version_id] << story
+ stories_by_version[story.version_id] << story
end
stories_by_version
@@ -135,7 +135,7 @@ class Story < WorkPackage
extras = ["and not #{WorkPackage.table_name}.position is NULL and #{WorkPackage.table_name}.position <= ?", position]
end
- @rank ||= WorkPackage.where(Story.condition(project.id, fixed_version_id, extras))
+ @rank ||= WorkPackage.where(Story.condition(project.id, version_id, extras))
.joins(:status)
.count
@rank
@@ -144,7 +144,7 @@ class Story < WorkPackage
private
def self.condition(project_id, sprint_ids, extras = [])
- c = ['project_id = ? AND type_id in (?) AND fixed_version_id in (?)',
+ c = ['project_id = ? AND type_id in (?) AND version_id in (?)',
project_id, Story.types, sprint_ids]
if extras.size > 0
diff --git a/modules/backlogs/app/views/rb_stories/_story.html.erb b/modules/backlogs/app/views/rb_stories/_story.html.erb
index 508e593ee49..e51d01df142 100644
--- a/modules/backlogs/app/views/rb_stories/_story.html.erb
+++ b/modules/backlogs/app/views/rb_stories/_story.html.erb
@@ -42,7 +42,7 @@ See docs/COPYRIGHT.rdoc for more details.
<div class="v"><%= type_id_or_empty(story) %></div>
</div>
<div class="subject editable ellipsis" fieldname="subject" fieldorder="2" title="<%= h story.subject %>" field_id=<%= story.id %>><%=h story.subject %></div>
- <div class="fixed_version_id"><%= story.fixed_version_id %></div>
+ <div class="version_id"><%= story.version_id %></div>
<div class="higher_item_id"><%= !defined?(higher_item) || higher_item.nil? ? '' : higher_item.id %></div>
<div class="meta">
<%= render(:partial => "shared/model_errors", :object => story.errors) if story.errors.size > 0 %>
diff --git a/modules/backlogs/config/locales/crowdin/ar.yml b/modules/backlogs/config/locales/crowdin/ar.yml
index e69d0b347eb..ce8b512d397 100644
--- a/modules/backlogs/config/locales/crowdin/ar.yml
+++ b/modules/backlogs/config/locales/crowdin/ar.yml
@@ -45,7 +45,7 @@ ar:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "هو غير صالح لأن مجموعة العمل '%{work_package_name}' هي مهمة عمل متراكم غير منجز ولذلك لا يمكن أن يكون أحد الأصول خارج المشروع الحالي."
diff --git a/modules/backlogs/config/locales/crowdin/bg.yml b/modules/backlogs/config/locales/crowdin/bg.yml
index 7776c3a4765..b96765ce4a5 100644
--- a/modules/backlogs/config/locales/crowdin/bg.yml
+++ b/modules/backlogs/config/locales/crowdin/bg.yml
@@ -45,7 +45,7 @@ bg:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "is invalid because the work package '%{work_package_name}' is a backlog task and therefore cannot have a parent outside of the current project."
diff --git a/modules/backlogs/config/locales/crowdin/ca.yml b/modules/backlogs/config/locales/crowdin/ca.yml
index dd33d04682f..408b6433364 100644
--- a/modules/backlogs/config/locales/crowdin/ca.yml
+++ b/modules/backlogs/config/locales/crowdin/ca.yml
@@ -45,7 +45,7 @@ ca:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "no és vàlid perquè el paquet de treball '%{work_package_name}' és una tasca de la llista de pendents i per tant no pot tenir un pare fora el projecte actual."
diff --git a/modules/backlogs/config/locales/crowdin/cs.yml b/modules/backlogs/config/locales/crowdin/cs.yml
index 70a13358bda..e56b87c22e8 100644
--- a/modules/backlogs/config/locales/crowdin/cs.yml
+++ b/modules/backlogs/config/locales/crowdin/cs.yml
@@ -45,7 +45,7 @@ cs:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "musí být stejná jako verze nadřazeného příběhu."
parent_id:
parent_child_relationship_across_projects: "je neplatný, protože pracovní balíček '%{work_package_name}' je nevyřízený úkol, a proto nemůže mít nadřazený mimo aktuální projekt."
diff --git a/modules/backlogs/config/locales/crowdin/da.yml b/modules/backlogs/config/locales/crowdin/da.yml
index 7ac7964369a..e655489c47a 100644
--- a/modules/backlogs/config/locales/crowdin/da.yml
+++ b/modules/backlogs/config/locales/crowdin/da.yml
@@ -45,7 +45,7 @@ da:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "er ugyldig, da arbejdspakken '%{work_package_name}' er en backlog-opgave og derfor ikke kan have en forælder uden for det aktuelle projekt."
diff --git a/modules/backlogs/config/locales/crowdin/de.yml b/modules/backlogs/config/locales/crowdin/de.yml
index 39c04e6abd1..b359fc2126d 100644
--- a/modules/backlogs/config/locales/crowdin/de.yml
+++ b/modules/backlogs/config/locales/crowdin/de.yml
@@ -45,7 +45,7 @@ de:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "muss der Version der übergeordneten Story entsprechen."
parent_id:
parent_child_relationship_across_projects: "ist ungültig da '%{work_package_name}' ein backlog Task ist und daher kein Eltern-Arbeitspaket außerhalb des jetzigen Projekts haben kann."
diff --git a/modules/backlogs/config/locales/crowdin/el.yml b/modules/backlogs/config/locales/crowdin/el.yml
index bc2b2cf0d8d..2a01027d1c8 100644
--- a/modules/backlogs/config/locales/crowdin/el.yml
+++ b/modules/backlogs/config/locales/crowdin/el.yml
@@ -45,7 +45,7 @@ el:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "πρέπει να είναι το ίδιο με την έκδοση ιστορίας του γονέα."
parent_id:
parent_child_relationship_across_projects: "δεν είναι έγκυρο επειδή το πακέτο εργασίας '%{work_package_name}' είναι μια εργασία backlog επομένως δεν μπορεί να έχει γονέα εκτός του τρέχοντος έργου."
diff --git a/modules/backlogs/config/locales/crowdin/es.yml b/modules/backlogs/config/locales/crowdin/es.yml
index 3049d4c4d3e..1b4d039e72a 100644
--- a/modules/backlogs/config/locales/crowdin/es.yml
+++ b/modules/backlogs/config/locales/crowdin/es.yml
@@ -45,7 +45,7 @@ es:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "debe coincidir con la versión de la historia principal."
parent_id:
parent_child_relationship_across_projects: "no es valido porque el paquete de trabjo '%{work_package_name}' es una tarea de backlog y por lo tanto no puede tener un padre fuera del proyecto actual."
diff --git a/modules/backlogs/config/locales/crowdin/fi.yml b/modules/backlogs/config/locales/crowdin/fi.yml
index 0451895f386..e3f6e689b10 100644
--- a/modules/backlogs/config/locales/crowdin/fi.yml
+++ b/modules/backlogs/config/locales/crowdin/fi.yml
@@ -45,7 +45,7 @@ fi:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "ei kelpaa, koska työpaketti \"%{work_package_name}\" on työjonossa ja siksi sillä ei voi olla edeltäjää nykyisen projektin ulkopuolella."
diff --git a/modules/backlogs/config/locales/crowdin/fil.yml b/modules/backlogs/config/locales/crowdin/fil.yml
index b835fbba457..09f905eeff5 100644
--- a/modules/backlogs/config/locales/crowdin/fil.yml
+++ b/modules/backlogs/config/locales/crowdin/fil.yml
@@ -45,7 +45,7 @@ fil:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "is invalid because the work package '%{work_package_name}' is a backlog task and therefore cannot have a parent outside of the current project."
diff --git a/modules/backlogs/config/locales/crowdin/fr.yml b/modules/backlogs/config/locales/crowdin/fr.yml
index bafef320a17..777170abd4a 100644
--- a/modules/backlogs/config/locales/crowdin/fr.yml
+++ b/modules/backlogs/config/locales/crowdin/fr.yml
@@ -45,7 +45,7 @@ fr:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "doit être identique à la version de l'histoire parente."
parent_id:
parent_child_relationship_across_projects: "n'est pas valide parce que le lot de travaux «%{work_package_name}» est une tâche de backlog et par conséquent ne peut avoir un parent en dehors du projet actuel."
diff --git a/modules/backlogs/config/locales/crowdin/hr.yml b/modules/backlogs/config/locales/crowdin/hr.yml
index c3c6b212f23..35580ee8ff0 100644
--- a/modules/backlogs/config/locales/crowdin/hr.yml
+++ b/modules/backlogs/config/locales/crowdin/hr.yml
@@ -45,7 +45,7 @@ hr:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "je neispravan zato što radni paket %{work_package_name} je backlog zadatak i kao takav ne može imati nadređenog izvan trenutnog projekta."
diff --git a/modules/backlogs/config/locales/crowdin/hu.yml b/modules/backlogs/config/locales/crowdin/hu.yml
index 348af9ec1fc..0152d3690c6 100644
--- a/modules/backlogs/config/locales/crowdin/hu.yml
+++ b/modules/backlogs/config/locales/crowdin/hu.yml
@@ -45,7 +45,7 @@ hu:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "érvénytelen, mert a munka csomag \"%{work_package_name}\" egy backlog feladat, ezért nem lehet a szülő nem az aktuális projektben."
diff --git a/modules/backlogs/config/locales/crowdin/id.yml b/modules/backlogs/config/locales/crowdin/id.yml
index 7c83bea76fa..553f0a2a3ca 100644
--- a/modules/backlogs/config/locales/crowdin/id.yml
+++ b/modules/backlogs/config/locales/crowdin/id.yml
@@ -45,7 +45,7 @@ id:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "harus sama seperti versi kisah orang tua."
parent_id:
parent_child_relationship_across_projects: "tidak valid karena paket kerja '%{work_package_name}' adalah tugas backlog dan oleh karena itu tidak dapat memiliki orang tua di luar proyek saat ini."
diff --git a/modules/backlogs/config/locales/crowdin/it.yml b/modules/backlogs/config/locales/crowdin/it.yml
index d1e46a6e0c4..c01ba0a2dd8 100644
--- a/modules/backlogs/config/locales/crowdin/it.yml
+++ b/modules/backlogs/config/locales/crowdin/it.yml
@@ -45,7 +45,7 @@ it:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "deve essere uguale alla versione della storia del genitore."
parent_id:
parent_child_relationship_across_projects: "non è valido perché il pacchetto di lavoro '%{work_package_name}' è un task di backlog e pertanto non può avere una dipendenza esterna al progetto corrente."
diff --git a/modules/backlogs/config/locales/crowdin/ja.yml b/modules/backlogs/config/locales/crowdin/ja.yml
index 858e187513b..ed31de7e141 100644
--- a/modules/backlogs/config/locales/crowdin/ja.yml
+++ b/modules/backlogs/config/locales/crowdin/ja.yml
@@ -45,7 +45,7 @@ ja:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "親ストーリーのバージョンと同じでなければなりません。"
parent_id:
parent_child_relationship_across_projects: "は無効です。作業項目'%{work_package_name}'はバックログタスクで、現在のプロジェクト外の親を持つことはできません。"
diff --git a/modules/backlogs/config/locales/crowdin/ko.yml b/modules/backlogs/config/locales/crowdin/ko.yml
index 4135945eba0..b031fb2cb11 100644
--- a/modules/backlogs/config/locales/crowdin/ko.yml
+++ b/modules/backlogs/config/locales/crowdin/ko.yml
@@ -45,7 +45,7 @@ ko:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "은(는) 부모 스토리의 버전과 동일해야 합니다."
parent_id:
parent_child_relationship_across_projects: "은(는) 유효하지 않습니다. 작업 패키지 '%{work_package_name}'이(가) 백로그 작업이기 때문입니다. 따라서 현재 프로젝트 외부에 부모가 있을 수 없습니다."
diff --git a/modules/backlogs/config/locales/crowdin/lt.yml b/modules/backlogs/config/locales/crowdin/lt.yml
index 213b0b4a7f5..96f200e5f64 100644
--- a/modules/backlogs/config/locales/crowdin/lt.yml
+++ b/modules/backlogs/config/locales/crowdin/lt.yml
@@ -45,7 +45,7 @@ lt:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "turi būti tokia pati kaip ir tėvinės istorijos versija."
parent_id:
parent_child_relationship_across_projects: "is invalid because the work package '%{work_package_name}' is a backlog task and therefore cannot have a parent outside of the current project."
diff --git a/modules/backlogs/config/locales/crowdin/nl.yml b/modules/backlogs/config/locales/crowdin/nl.yml
index 6536150cc86..fa46f6109cb 100644
--- a/modules/backlogs/config/locales/crowdin/nl.yml
+++ b/modules/backlogs/config/locales/crowdin/nl.yml
@@ -45,7 +45,7 @@ nl:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "moet hetzelfde zijn als de ouder verhaalversie."
parent_id:
parent_child_relationship_across_projects: "is ongeldig omdat het werkpakket '%{work_package_name}' een backlogtaak is en vandaar kan geen ouder buiten het huidige project hebben."
diff --git a/modules/backlogs/config/locales/crowdin/no.yml b/modules/backlogs/config/locales/crowdin/no.yml
index 5b5a66e8641..58e9a7b3362 100644
--- a/modules/backlogs/config/locales/crowdin/no.yml
+++ b/modules/backlogs/config/locales/crowdin/no.yml
@@ -45,7 +45,7 @@
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "is invalid because the work package '%{work_package_name}' is a backlog task and therefore cannot have a parent outside of the current project."
diff --git a/modules/backlogs/config/locales/crowdin/pl.yml b/modules/backlogs/config/locales/crowdin/pl.yml
index 74cb303c1d5..7e56f532740 100644
--- a/modules/backlogs/config/locales/crowdin/pl.yml
+++ b/modules/backlogs/config/locales/crowdin/pl.yml
@@ -45,7 +45,7 @@ pl:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "musi być taka sama jak wersja story nadrzędnej."
parent_id:
parent_child_relationship_across_projects: "jest nieprawidłowy, ponieważ paczka prac '%{work_package_name}' jest zadaniem backlogu, a więc nie może mieć rodziciela poza bieżącym projektem."
diff --git a/modules/backlogs/config/locales/crowdin/pt-BR.yml b/modules/backlogs/config/locales/crowdin/pt-BR.yml
index 2d7123c9462..b1a5a5d0ae7 100644
--- a/modules/backlogs/config/locales/crowdin/pt-BR.yml
+++ b/modules/backlogs/config/locales/crowdin/pt-BR.yml
@@ -45,7 +45,7 @@ pt-BR:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "deve ser igual à versão da história dos pais."
parent_id:
parent_child_relationship_across_projects: "é inválido porque o pacote de trabalho '%{work_package_name}' é uma tarefa do backlog e, portanto, não pode ter um pai fora do projeto atual."
diff --git a/modules/backlogs/config/locales/crowdin/pt.yml b/modules/backlogs/config/locales/crowdin/pt.yml
index f7de0b2f0b3..022f1dcc2bb 100644
--- a/modules/backlogs/config/locales/crowdin/pt.yml
+++ b/modules/backlogs/config/locales/crowdin/pt.yml
@@ -45,7 +45,7 @@ pt:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "tem ser o mesmo que a versão da história do pai."
parent_id:
parent_child_relationship_across_projects: "é inválido porque o pacote de trabalho '%{work_package_name}' é uma tarefa da lista de acumulados e, portanto, não pode ter um parente fora do projeto atual."
diff --git a/modules/backlogs/config/locales/crowdin/ro.yml b/modules/backlogs/config/locales/crowdin/ro.yml
index fe692dafed0..4e89ffa64f7 100644
--- a/modules/backlogs/config/locales/crowdin/ro.yml
+++ b/modules/backlogs/config/locales/crowdin/ro.yml
@@ -45,7 +45,7 @@ ro:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "is invalid because the work package '%{work_package_name}' is a backlog task and therefore cannot have a parent outside of the current project."
diff --git a/modules/backlogs/config/locales/crowdin/ru.yml b/modules/backlogs/config/locales/crowdin/ru.yml
index cf68861e45d..c5dd432375e 100644
--- a/modules/backlogs/config/locales/crowdin/ru.yml
+++ b/modules/backlogs/config/locales/crowdin/ru.yml
@@ -45,7 +45,7 @@ ru:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "должен быть таким же, как этап родительской истории."
parent_id:
parent_child_relationship_across_projects: "недействителен, поскольку пакет работ '%{work_package_name}' - это невыполненное задание и, следовательно, не может иметь родителя за пределами текущего проекта."
diff --git a/modules/backlogs/config/locales/crowdin/sk.yml b/modules/backlogs/config/locales/crowdin/sk.yml
index 95567ac30ae..59069f86100 100644
--- a/modules/backlogs/config/locales/crowdin/sk.yml
+++ b/modules/backlogs/config/locales/crowdin/sk.yml
@@ -45,7 +45,7 @@ sk:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "musí byť rovnaká ako verzia nadradeného článku."
parent_id:
parent_child_relationship_across_projects: "je neplatný, pretože pracovný balíček '%{work_package_name}' je nevyriešená úloha a preto nemôže byť nadradeným mimo súčasného projektu."
diff --git a/modules/backlogs/config/locales/crowdin/sv.yml b/modules/backlogs/config/locales/crowdin/sv.yml
index fe4814fbb03..abe3b61606c 100644
--- a/modules/backlogs/config/locales/crowdin/sv.yml
+++ b/modules/backlogs/config/locales/crowdin/sv.yml
@@ -45,7 +45,7 @@ sv:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "måste vara samma som föräldraberättelsens version."
parent_id:
parent_child_relationship_across_projects: "är ogiltig eftersom arbetspaketet '%{work_package_name}' är en backlog aktivitet och kan därför inte ha en förälder utanför det aktuella projektet."
diff --git a/modules/backlogs/config/locales/crowdin/tr.yml b/modules/backlogs/config/locales/crowdin/tr.yml
index 2bf558bbeac..934da36d9d4 100644
--- a/modules/backlogs/config/locales/crowdin/tr.yml
+++ b/modules/backlogs/config/locales/crowdin/tr.yml
@@ -45,7 +45,7 @@ tr:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "ana hikaye sürümüyle aynı olmalıdır."
parent_id:
parent_child_relationship_across_projects: "iş paketi bir bekleme listesi işidir ve bu nedenle mevcut projenin dışında bir üst öğeye sahip olamaz.%{work_package_name}"
diff --git a/modules/backlogs/config/locales/crowdin/uk.yml b/modules/backlogs/config/locales/crowdin/uk.yml
index fd85124852a..3e1490eedc0 100644
--- a/modules/backlogs/config/locales/crowdin/uk.yml
+++ b/modules/backlogs/config/locales/crowdin/uk.yml
@@ -45,7 +45,7 @@ uk:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "має бути така сама як батьківська версія історії."
parent_id:
parent_child_relationship_across_projects: "є недійсним, оскільки робочий пакет '%{work_package_name}' є завданням backlog-у і тому не може мати батька поза поточним проектом."
diff --git a/modules/backlogs/config/locales/crowdin/vi.yml b/modules/backlogs/config/locales/crowdin/vi.yml
index f6884e6de2b..2352825beee 100644
--- a/modules/backlogs/config/locales/crowdin/vi.yml
+++ b/modules/backlogs/config/locales/crowdin/vi.yml
@@ -45,7 +45,7 @@ vi:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "is invalid because the work package '%{work_package_name}' is a backlog task and therefore cannot have a parent outside of the current project."
diff --git a/modules/backlogs/config/locales/crowdin/zh-CN.yml b/modules/backlogs/config/locales/crowdin/zh-CN.yml
index c1a44ad3368..8230475be82 100644
--- a/modules/backlogs/config/locales/crowdin/zh-CN.yml
+++ b/modules/backlogs/config/locales/crowdin/zh-CN.yml
@@ -45,7 +45,7 @@ zh-CN:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "必须与父级故事的版本相同。"
parent_id:
parent_child_relationship_across_projects: "无效,因为工作包“%{work_package_name}”是一个待办清单任务,不能具有当前项目以外的上级项目。"
diff --git a/modules/backlogs/config/locales/crowdin/zh-TW.yml b/modules/backlogs/config/locales/crowdin/zh-TW.yml
index 4f3449907ec..9874a3417dc 100644
--- a/modules/backlogs/config/locales/crowdin/zh-TW.yml
+++ b/modules/backlogs/config/locales/crowdin/zh-TW.yml
@@ -45,7 +45,7 @@ zh-TW:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "必須與\"父\"直屬故事的版本相同。"
parent_id:
parent_child_relationship_across_projects: "是不正確的,因為這個工作項目 '%{work_package_name}' 是一個待辦任務,它不可以擁有一個在目前的專案以外的上層項目"
diff --git a/modules/backlogs/config/locales/en.yml b/modules/backlogs/config/locales/en.yml
index 31952fed706..be2938490df 100644
--- a/modules/backlogs/config/locales/en.yml
+++ b/modules/backlogs/config/locales/en.yml
@@ -54,7 +54,7 @@ en:
models:
work_package:
attributes:
- fixed_version_id:
+ version_id:
task_version_must_be_the_same_as_story_version: "must be the same as the parent story's version."
parent_id:
parent_child_relationship_across_projects: "is invalid because the work package '%{work_package_name}' is a backlog task and therefore cannot have a parent outside of the current project."
diff --git a/modules/backlogs/features/step_definitions/_given_steps.rb b/modules/backlogs/features/step_definitions/_given_steps.rb
index 2c2fb1e2967..459226cde2a 100644
--- a/modules/backlogs/features/step_definitions/_given_steps.rb
+++ b/modules/backlogs/features/step_definitions/_given_steps.rb
@@ -38,7 +38,7 @@ Given /^I set the (.+) of the story to (.+)$/ do |attribute, value|
attribute = 'status_id'
value = Status.find_by(name: value).id
elsif %w[backlog sprint].include? attribute
- attribute = 'fixed_version_id'
+ attribute = 'version_id'
value = Version.find_by(name: value).id
end
@story_params[attribute] = value
@@ -171,7 +171,7 @@ Given /^the [pP]roject(?: "([^\"]*)")? has the following stories in the followin
params = initialize_story_params(project)
params['parent'] = WorkPackage.find_by(subject: story['parent'])
params['subject'] = story['subject']
- params['fixed_version_id'] = Version.find_by(name: story['sprint'] || story['backlog']).id
+ params['version_id'] = Version.find_by(name: story['sprint'] || story['backlog']).id
params['story_points'] = story['story_points']
params['status'] = if story['status']
Status.find_by(name: story['status'])
@@ -237,7 +237,7 @@ Given /^the [pP]roject(?: "([^\"]*)")? has the following work_packages:$/ do |pr
params = initialize_work_package_params(project, type, parent)
params['subject'] = task['subject']
version = Version.find_by(name: task['sprint'] || task['backlog'])
- params['fixed_version_id'] = version.id if version
+ params['version_id'] = version.id if version
params['priority'] = if task['priority']
IssuePriority.find_by(name: task['priority'])
else
diff --git a/modules/backlogs/features/step_definitions/_then_steps.rb b/modules/backlogs/features/step_definitions/_then_steps.rb
index 4e4329ed91c..87b607b7b5c 100644
--- a/modules/backlogs/features/step_definitions/_then_steps.rb
+++ b/modules/backlogs/features/step_definitions/_then_steps.rb
@@ -28,7 +28,7 @@
Then /^(.+) should be in the (\d+)(?:st|nd|rd|th) position of the sprint named (.+)$/ do |story_subject, position, sprint_name|
position = position.to_i
- story = Story.where(subject: story_subject, versions: { name: sprint_name }).joins(:fixed_version).first
+ story = Story.where(subject: story_subject, versions: { name: sprint_name }).joins(:version).first
story_position(story).should == position.to_i
end
@@ -90,7 +90,7 @@ Then /^show me the list of stories$/ do
puts "\n"
puts "\t| #{'id'.ljust(5)} | #{'position'.ljust(8)} | #{'status'.ljust(12)} | #{'rank'.ljust(4)} | #{'subject'.ljust(subject_max)} | #{'sprint'.ljust(sprint_max)} |"
stories.each do |story|
- puts "\t| #{story.id.to_s.ljust(5)} | #{story.position.to_s.ljust(8)} | #{story.status.name[0, 12].ljust(12)} | #{story.rank.to_s.ljust(4)} | #{story.subject.ljust(subject_max)} | #{(story.fixed_version_id.nil? ? Sprint.new : Sprint.find(story.fixed_version_id)).name.ljust(sprint_max)} |"
+ puts "\t| #{story.id.to_s.ljust(5)} | #{story.position.to_s.ljust(8)} | #{story.status.name[0, 12].ljust(12)} | #{story.rank.to_s.ljust(4)} | #{story.subject.ljust(subject_max)} | #{(story.version_id.nil? ? Sprint.new : Sprint.find(story.version_id)).name.ljust(sprint_max)} |"
end
puts "\n\n"
end
@@ -133,12 +133,12 @@ end
Then /^the (\d+)(?:st|nd|rd|th) story in (?:the )?"(.+?)" should have the ID of "(.+?)"$/ do |position, version_name, subject|
version = Version.find_by(name: version_name)
- actual_story = WorkPackage.find_by(subject: subject, fixed_version_id: version.id)
+ actual_story = WorkPackage.find_by(subject: subject, version_id: version.id)
step %%I should see "#{actual_story.id}" within "#backlog_#{version.id} .story:nth-child(#{position}) .id div.t"%
end
Then /^all positions should be unique for each version$/ do
- Story.find_by_sql("select project_id, fixed_version_id, position, count(*) as dups from #{WorkPackage.table_name} where not position is NULL group by project_id, fixed_version_id, position having count(*) > 1").length.should == 0
+ Story.find_by_sql("select project_id, version_id, position, count(*) as dups from #{WorkPackage.table_name} where not position is NULL group by project_id, version_id, position having count(*) > 1").length.should == 0
end
Then /^the (\d+)(?:st|nd|rd|th) task for (.+) should be (.+)$/ do |position, story_subject, task_subject|
@@ -246,7 +246,7 @@ Then /^the (?:work_package|task|story) "(.+?)" should have "(.+?)" as its target
work_package = WorkPackage.find_by(subject: task_name)
version = Version.find_by(name: version_name)
- work_package.fixed_version.should eql version
+ work_package.version.should eql version
end
Then /^there should not be a saving error on task "(.+?)"$/ do |task_name|
diff --git a/modules/backlogs/features/step_definitions/_when_steps.rb b/modules/backlogs/features/step_definitions/_when_steps.rb
index f6805356d5f..6382a76d845 100644
--- a/modules/backlogs/features/step_definitions/_when_steps.rb
+++ b/modules/backlogs/features/step_definitions/_when_steps.rb
@@ -28,19 +28,19 @@
When /^I create the impediment$/ do
page.driver.post backlogs_project_sprint_impediments_url(
- *@impediment_params.values_at('project_id', 'fixed_version_id')
+ *@impediment_params.values_at('project_id', 'version_id')
), @impediment_params.except('author_id', 'author')
end
When /^I create the story$/ do
page.driver.post backlogs_project_sprint_stories_url(
- *@story_params.values_at('project_id', 'fixed_version_id')
+ *@story_params.values_at('project_id', 'version_id')
), @story_params.except('author_id', 'author')
end
When /^I create the task$/ do
page.driver.post backlogs_project_sprint_tasks_url(
- *@task_params.values_at('project_id', 'fixed_version_id')
+ *@task_params.values_at('project_id', 'version_id')
), @task_params.except('author_id', 'author')
end
@@ -56,11 +56,11 @@ When /^I move the (story|item|task) named (.+) below (.+)$/ do |type, story_subj
# #attributes returns the parent_id to always be nil
attributes['parent_id'] = story.parent_id
else
- attributes[:fixed_version_id] = prev.fixed_version_id
+ attributes[:version_id] = prev.version_id
end
project = Project.find(attributes['project_id'])
- sprint = prev.fixed_version
+ sprint = prev.version
page.driver.post polymorphic_url(
[:backlogs, project, sprint.becomes(Sprint), story]
@@ -71,19 +71,19 @@ When /^I move the story named (.+) (up|down) to the (\d+)(?:st|nd|rd|th) positio
position = position.to_i
story = Story.find_by(subject: story_subject)
sprint = Sprint.find_by(name: sprint_name)
- story.fixed_version = sprint
+ story.version = sprint
attributes = story.attributes
attributes[:prev] = if position == 1
''
else
- stories = Story.where(fixed_version_id: sprint.id, type_id: Story.types).order(Arel.sql('position ASC'))
+ stories = Story.where(version_id: sprint.id, type_id: Story.types).order(Arel.sql('position ASC'))
raise "You indicated an invalid position (#{position}) in a sprint with #{stories.length} stories" if 0 > position or position > stories.length
stories[position - (direction == 'up' ? 2 : 1)].id
end
page.driver.post backlogs_project_sprint_story_url(
- *attributes.values_at('project_id', 'fixed_version_id', 'id')
+ *attributes.values_at('project_id', 'version_id', 'id')
), attributes.merge('_method' => 'put')
end
@@ -107,14 +107,14 @@ When /^I move the (\d+)(?:st|nd|rd|th) story to the (\d+|last)(?:st|nd|rd|th)? p
page.driver.post backlogs_project_sprint_story_url(
@project.id,
- @story.fixed_version_id,
+ @story.version_id,
@story.id
), prev: (prev.nil? ? '' : prev.text), '_method' => 'put'
end
When /^I update the impediment$/ do
page.driver.post backlogs_project_sprint_impediment_url(
- *@impediment_params.values_at('project_id', 'fixed_version_id', 'id')
+ *@impediment_params.values_at('project_id', 'version_id', 'id')
), @impediment_params.merge('_method' => 'put')
end
@@ -126,13 +126,13 @@ end
When /^I update the story$/ do
page.driver.post backlogs_project_sprint_story_url(
- *@story_params.values_at('project_id', 'fixed_version_id', 'id')
+ *@story_params.values_at('project_id', 'version_id', 'id')
), @story_params.merge('_method' => 'put')
end
When /^I update the task$/ do
page.driver.post backlogs_project_sprint_task_url(
- *@task_params.values_at('project_id', 'fixed_version_id', 'id')
+ *@task_params.values_at('project_id', 'version_id', 'id')
), @task_params.merge('_method' => 'put')
end
diff --git a/modules/backlogs/features/step_definitions/helpers.rb b/modules/backlogs/features/step_definitions/helpers.rb
index 2b1f363c54e..87025d32b54 100644
--- a/modules/backlogs/features/step_definitions/helpers.rb
+++ b/modules/backlogs/features/step_definitions/helpers.rb
@@ -44,7 +44,7 @@ def initialize_task_params(project, story, user = User.first)
params = HashWithIndifferentAccess.new
params['type_id'] = Task.type
if story
- params['fixed_version_id'] = story.fixed_version_id
+ params['version_id'] = story.version_id
params['parent_id'] = story.id
end
params['status_id'] = Status.first.id
@@ -76,7 +76,7 @@ end
def initialize_impediment_params(project, sprint, user = User.first)
params = HashWithIndifferentAccess.new(RbTasksController::PERMITTED_PARAMS)
params['type_id'] = Task.type
- params['fixed_version_id'] = sprint.id
+ params['version_id'] = sprint.id
params['status_id'] = Status.first.id
# unsafe attributes that will not be used directly but added for your
@@ -96,11 +96,11 @@ def task_position(task)
end
def story_position(story)
- p1 = Story.sprint_backlog(story.project, story.fixed_version).detect { |s| s.id == story.id }.rank
+ p1 = Story.sprint_backlog(story.project, story.version).detect { |s| s.id == story.id }.rank
p2 = story.rank
p1.should == p2
- Story.at_rank(story.project_id, story.fixed_version_id, p1).id.should == story.id
+ Story.at_rank(story.project_id, story.version_id, p1).id.should == story.id
p1
end
diff --git a/modules/backlogs/lib/open_project/backlogs/burndown/series_raw_data.rb b/modules/backlogs/lib/open_project/backlogs/burndown/series_raw_data.rb
index bf4cf33a7f4..1c84c74d472 100644
--- a/modules/backlogs/lib/open_project/backlogs/burndown/series_raw_data.rb
+++ b/modules/backlogs/lib/open_project/backlogs/burndown/series_raw_data.rb
@@ -93,7 +93,7 @@ module OpenProject::Backlogs::Burndown
work_package_journals
JOIN journals AS id_journals
ON work_package_journals.journal_id = id_journals.id
- AND #{fixed_version_query}
+ AND #{version_query}
AND #{project_id_query}
AND #{type_id_query}
#{and_status_query}
@@ -139,7 +139,7 @@ module OpenProject::Backlogs::Burndown
JOIN
work_package_journals
ON journals.id = work_package_journals.journal_id
- AND #{fixed_version_query}
+ AND #{version_query}
AND #{project_id_query}
AND #{type_id_query}
#{and_status_query})
@@ -182,8 +182,8 @@ module OpenProject::Backlogs::Burndown
end
end
- def fixed_version_query
- @fixed_version_query ||= "(#{Journal::WorkPackageJournal.table_name}.fixed_version_id = #{sprint.id})"
+ def version_query
+ @version_query ||= "(#{Journal::WorkPackageJournal.table_name}.version_id = #{sprint.id})"
end
def project_id_query
diff --git a/modules/backlogs/lib/open_project/backlogs/list.rb b/modules/backlogs/lib/open_project/backlogs/list.rb
index b747c030883..198286a18ed 100644
--- a/modules/backlogs/lib/open_project/backlogs/list.rb
+++ b/modules/backlogs/lib/open_project/backlogs/list.rb
@@ -45,8 +45,8 @@ module OpenProject::Backlogs::List
# Also sanitize_sql seems to be unavailable in a sensible way. Therefore
# we're using send to circumvent visibility work_packages.
def scope_condition
- self.class.send(:sanitize_sql, ['project_id = ? AND fixed_version_id = ? AND type_id IN (?)',
- project_id, fixed_version_id, types])
+ self.class.send(:sanitize_sql, ['project_id = ? AND version_id = ? AND type_id IN (?)',
+ project_id, version_id, types])
end
include InstanceMethods
@@ -86,17 +86,17 @@ module OpenProject::Backlogs::List
end
def fix_other_work_package_positions
- if changes.slice('project_id', 'type_id', 'fixed_version_id').present?
- if changes.slice('project_id', 'fixed_version_id').blank? and
+ if changes.slice('project_id', 'type_id', 'version_id').present?
+ if changes.slice('project_id', 'version_id').blank? and
Story.types.include?(type_id.to_i) and
Story.types.include?(type_id_was.to_i)
return
end
- if fixed_version_id_changed?
+ if version_id_changed?
restore_version_id = true
- new_version_id = fixed_version_id
- self.fixed_version_id = fixed_version_id_was
+ new_version_id = version_id
+ self.version_id = version_id_was
end
if type_id_changed?
@@ -124,20 +124,20 @@ module OpenProject::Backlogs::List
end
if restore_version_id
- self.fixed_version_id = new_version_id
+ self.version_id = new_version_id
end
end
end
def fix_own_work_package_position
- if changes.slice('project_id', 'type_id', 'fixed_version_id').present?
- if changes.slice('project_id', 'fixed_version_id').blank? and
+ if changes.slice('project_id', 'type_id', 'version_id').present?
+ if changes.slice('project_id', 'version_id').blank? and
Story.types.include?(type_id.to_i) and
Story.types.include?(type_id_was.to_i)
return
end
- if is_story? and fixed_version.present?
+ if is_story? and version.present?
assume_bottom_position
else
remove_from_list
@@ -146,7 +146,7 @@ module OpenProject::Backlogs::List
end
def set_default_prev_positions_silently(prev)
- prev.fixed_version.rebuild_positions(prev.project)
+ prev.version.rebuild_positions(prev.project)
prev.reload.position
end
end
diff --git a/modules/backlogs/lib/open_project/backlogs/patches/base_contract_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/base_contract_patch.rb
index ef738ef7aad..57075cca384 100644
--- a/modules/backlogs/lib/open_project/backlogs/patches/base_contract_patch.rb
+++ b/modules/backlogs/lib/open_project/backlogs/patches/base_contract_patch.rb
@@ -33,16 +33,16 @@ module OpenProject::Backlogs::Patches::BaseContractPatch
attribute :remaining_hours
attribute :story_points
- validate :validate_has_parents_fixed_version
+ validate :validate_has_parents_version
validate :validate_parent_work_package_relation
private
- def validate_has_parents_fixed_version
+ def validate_has_parents_version
if model.is_task? &&
model.parent && model.parent.in_backlogs_type? &&
- model.fixed_version_id != model.parent.fixed_version_id
- errors.add :fixed_version_id, :task_version_must_be_the_same_as_story_version
+ model.version_id != model.parent.version_id
+ errors.add :version_id, :task_version_must_be_the_same_as_story_version
end
end
diff --git a/modules/backlogs/lib/open_project/backlogs/patches/set_attributes_service_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/set_attributes_service_patch.rb
index 14adbf3ed36..0b87c34a390 100644
--- a/modules/backlogs/lib/open_project/backlogs/patches/set_attributes_service_patch.rb
+++ b/modules/backlogs/lib/open_project/backlogs/patches/set_attributes_service_patch.rb
@@ -37,11 +37,11 @@ module OpenProject::Backlogs::Patches::SetAttributesServicePatch
if work_package.parent_id_changed? &&
work_package.parent_id &&
- !work_package.fixed_version_id_changed? &&
+ !work_package.version_id_changed? &&
work_package.in_backlogs_type?
closest = closest_story_or_impediment(work_package.parent_id)
- work_package.fixed_version_id = closest.fixed_version_id if closest
+ work_package.version_id = closest.version_id if closest
end
end
diff --git a/modules/backlogs/lib/open_project/backlogs/patches/update_service_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/update_service_patch.rb
index b44a7f53ecb..f6a48d59f4e 100644
--- a/modules/backlogs/lib/open_project/backlogs/patches/update_service_patch.rb
+++ b/modules/backlogs/lib/open_project/backlogs/patches/update_service_patch.rb
@@ -35,7 +35,7 @@ module OpenProject::Backlogs::Patches::UpdateServicePatch
def update_descendants
super_result = super
- if work_package.in_backlogs_type? && work_package.fixed_version_id_changed?
+ if work_package.in_backlogs_type? && work_package.version_id_changed?
inherit_version_to_descendants(super_result)
end
@@ -56,7 +56,7 @@ module OpenProject::Backlogs::Patches::UpdateServicePatch
end
end
- attributes = { fixed_version_id: work_package.fixed_version_id }
+ attributes = { version_id: work_package.version_id }
descendant_tasks.each do |task|
result.add_dependent!(set_attributes(attributes, task))
diff --git a/modules/backlogs/lib/open_project/backlogs/patches/version_patch.rb b/modules/backlogs/lib/open_project/backlogs/patches/version_patch.rb
index 7cc5482ba15..87e353979a2 100644
--- a/modules/backlogs/lib/open_project/backlogs/patches/version_patch.rb
+++ b/modules/backlogs/lib/open_project/backlogs/patches/version_patch.rb
@@ -49,9 +49,9 @@ module OpenProject::Backlogs::Patches::VersionPatch
# Add work_packages w/o position to the top of the list and add
# work_packages, that have a position, at the end
- stories_wo_position = fixed_issues.where(project_id: project, type_id: Story.types, position: nil).order(Arel.sql('id'))
+ stories_wo_position = work_packages.where(project_id: project, type_id: Story.types, position: nil).order(Arel.sql('id'))
- stories_w_position = fixed_issues.where(project_id: project, type_id: Story.types)
+ stories_w_position = work_packages.where(project_id: project, type_id: Story.types)
.where('position IS NOT NULL')
.order(Arel.sql('COALESCE(position, 0), id'))
diff --git a/modules/backlogs/spec/contracts/work_packages/base_contract_spec.rb b/modules/backlogs/spec/contracts/work_packages/base_contract_spec.rb
index c27942249dc..b93f779cea0 100644
--- a/modules/backlogs/spec/contracts/work_packages/base_contract_spec.rb
+++ b/modules/backlogs/spec/contracts/work_packages/base_contract_spec.rb
@@ -76,7 +76,7 @@ describe WorkPackages::BaseContract, type: :model do
subject: 'Story',
project: project,
type: type_feature,
- fixed_version: version1,
+ version: version1,
status: status,
author: user,
priority: issue_priority)
@@ -87,7 +87,7 @@ describe WorkPackages::BaseContract, type: :model do
subject: 'Story2',
project: project,
type: type_feature,
- fixed_version: version1,
+ version: version1,
status: status,
author: user,
priority: issue_priority)
@@ -97,7 +97,7 @@ describe WorkPackages::BaseContract, type: :model do
FactoryBot.build_stubbed(:stubbed_work_package,
subject: 'Task',
type: type_task,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -108,7 +108,7 @@ describe WorkPackages::BaseContract, type: :model do
FactoryBot.build_stubbed(:stubbed_work_package,
subject: 'Task2',
type: type_task,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -119,7 +119,7 @@ describe WorkPackages::BaseContract, type: :model do
FactoryBot.build_stubbed(:stubbed_work_package,
subject: 'Bug',
type: type_bug,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -130,7 +130,7 @@ describe WorkPackages::BaseContract, type: :model do
FactoryBot.build_stubbed(:stubbed_work_package,
subject: 'Bug2',
type: type_bug,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -155,129 +155,129 @@ describe WorkPackages::BaseContract, type: :model do
end
end
- describe 'fixed_version being restricted' do
+ describe 'version being restricted' do
shared_examples_for 'is invalid and notes the error' do
it 'is invalid and notes the error' do
expect(subject).to be_falsey
- expect(instance.errors.symbols_for(:fixed_version_id))
+ expect(instance.errors.symbols_for(:version_id))
.to match_array([:task_version_must_be_the_same_as_story_version])
end
end
- shared_examples_for 'fixed version being restricted by the parent' do
+ shared_examples_for 'version being restricted by the parent' do
before(:each) do
work_package.parent = parent unless work_package.parent.present?
end
- describe 'WITHOUT a fixed version and the parent also having no fixed version' do
+ describe 'WITHOUT a version and the parent also having no version' do
before(:each) do
- parent.fixed_version = nil
- work_package.fixed_version = nil
+ parent.version = nil
+ work_package.version = nil
end
it_behaves_like 'is valid'
end
- describe 'WITHOUT a fixed version and the parent having a fixed version' do
+ describe 'WITHOUT a version and the parent having a version' do
before(:each) do
- parent.fixed_version = version1
- work_package.fixed_version = nil
+ parent.version = version1
+ work_package.version = nil
end
it_behaves_like 'is invalid and notes the error'
end
- describe 'WITH a fixed version and the parent having a different fixed version' do
+ describe 'WITH a version and the parent having a different version' do
before(:each) do
- parent.fixed_version = version1
- work_package.fixed_version = version2
+ parent.version = version1
+ work_package.version = version2
end
it_behaves_like 'is invalid and notes the error'
end
- describe 'WITH a fixed version and the parent having the same fixed version' do
+ describe 'WITH a version and the parent having the same version' do
before(:each) do
- parent.fixed_version = version1
- work_package.fixed_version = version1
+ parent.version = version1
+ work_package.version = version1
end
it_behaves_like 'is valid'
end
- describe 'WITH a fixed version and the parent having no fixed version' do
+ describe 'WITH a version and the parent having no version' do
before(:each) do
- parent.fixed_version = nil
- work_package.fixed_version = version1
+ parent.version = nil
+ work_package.version = version1
end
it_behaves_like 'is invalid and notes the error'
end
end
- shared_examples_for 'fixed version not being restricted by the parent' do
+ shared_examples_for 'version not being restricted by the parent' do
before(:each) do
work_package.parent = parent unless work_package.parent.present?
end
- describe 'WITHOUT a fixed version and the parent also having no fixed version' do
+ describe 'WITHOUT a version and the parent also having no version' do
before(:each) do
- parent.fixed_version = nil
- work_package.fixed_version = nil
+ parent.version = nil
+ work_package.version = nil
end
it_behaves_like 'is valid'
end
- describe 'WITHOUT a fixed version and the parent having a fixed version' do
+ describe 'WITHOUT a version and the parent having a version' do
before(:each) do
- parent.fixed_version = version1
- work_package.fixed_version = nil
+ parent.version = version1
+ work_package.version = nil
end
it_behaves_like 'is valid'
end
- describe 'WITH a fixed version and the parent having a different fixed version' do
+ describe 'WITH a version and the parent having a different version' do
before(:each) do
- parent.fixed_version = version1
- work_package.fixed_version = version2
+ parent.version = version1
+ work_package.version = version2
end
it_behaves_like 'is valid'
end
- describe 'WITH a fixed version and the parent having the same fixed version' do
+ describe 'WITH a version and the parent having the same version' do
before(:each) do
- parent.fixed_version = version1
- work_package.fixed_version = version1
+ parent.version = version1
+ work_package.version = version1
end
it_behaves_like 'is valid'
end
- describe 'WITH a fixed version and the parent having no fixed version' do
+ describe 'WITH a version and the parent having no version' do
before(:each) do
- parent.fixed_version = nil
- work_package.fixed_version = version1
+ parent.version = nil
+ work_package.version = version1
end
it_behaves_like 'is valid'
end
end
- shared_examples_for 'fixed version without restriction' do
- describe 'WITHOUT a fixed version' do
+ shared_examples_for 'version without restriction' do
+ describe 'WITHOUT a version' do
before(:each) do
- work_package.fixed_version = nil
+ work_package.version = nil
end
it_behaves_like 'is valid'
end
- describe 'WITH a fixed version' do
+ describe 'WITH a version' do
before(:each) do
- work_package.fixed_version = version1
+ work_package.version = version1
end
it_behaves_like 'is valid'
@@ -288,19 +288,19 @@ describe WorkPackages::BaseContract, type: :model do
let(:work_package) { story }
describe 'WITHOUT a parent work_package' do
- it_should_behave_like 'fixed version without restriction'
+ it_should_behave_like 'version without restriction'
end
describe "WITH a story as its parent" do
let(:parent) { story2 }
- it_should_behave_like 'fixed version not being restricted by the parent'
+ it_should_behave_like 'version not being restricted by the parent'
end
describe "WITH a non backlogs tracked work_package as its parent" do
let(:parent) { bug }
- it_should_behave_like 'fixed version not being restricted by the parent'
+ it_should_behave_like 'version not being restricted by the parent'
end
end
@@ -308,7 +308,7 @@ describe WorkPackages::BaseContract, type: :model do
let(:work_package) { task }
describe 'WITHOUT a parent work_package (would then be an impediment)' do
- it_should_behave_like 'fixed version without restriction'
+ it_should_behave_like 'version without restriction'
end
describe "WITH a task as its parent" do
@@ -318,19 +318,19 @@ describe WorkPackages::BaseContract, type: :model do
let(:parent) { task2 }
- it_should_behave_like 'fixed version being restricted by the parent'
+ it_should_behave_like 'version being restricted by the parent'
end
describe "WITH a story as its parent" do
let(:parent) { story }
- it_should_behave_like 'fixed version being restricted by the parent'
+ it_should_behave_like 'version being restricted by the parent'
end
describe "WITH a non backlogs tracked work_package as its parent" do
let(:parent) { bug }
- it_should_behave_like 'fixed version not being restricted by the parent'
+ it_should_behave_like 'version not being restricted by the parent'
end
end
@@ -338,25 +338,25 @@ describe WorkPackages::BaseContract, type: :model do
let(:work_package) { bug }
describe 'WITHOUT a parent work_package' do
- it_should_behave_like 'fixed version without restriction'
+ it_should_behave_like 'version without restriction'
end
describe "WITH a task as its parent" do
let(:parent) { task2 }
- it_should_behave_like 'fixed version not being restricted by the parent'
+ it_should_behave_like 'version not being restricted by the parent'
end
describe "WITH a story as its parent" do
let(:parent) { story }
- it_should_behave_like 'fixed version not being restricted by the parent'
+ it_should_behave_like 'version not being restricted by the parent'
end
describe "WITH a non backlogs tracked work_package as its parent" do
let(:parent) { bug2 }
- it_should_behave_like 'fixed version not being restricted by the parent'
+ it_should_behave_like 'version not being restricted by the parent'
end
end
end
diff --git a/modules/backlogs/spec/features/backlogs/create_story_spec.rb b/modules/backlogs/spec/features/backlogs/create_story_spec.rb
index 953c0ab0278..e2bd58ae3e0 100644
--- a/modules/backlogs/spec/features/backlogs/create_story_spec.rb
+++ b/modules/backlogs/spec/features/backlogs/create_story_spec.rb
@@ -70,7 +70,7 @@ describe 'Backlogs', js: true do
priority: default_priority,
position: 1,
story_points: 3,
- fixed_version: backlog_version )
+ version: backlog_version )
end
let!(:existing_story2) do
FactoryBot.create(:work_package,
@@ -80,7 +80,7 @@ describe 'Backlogs', js: true do
priority: default_priority,
position: 2,
story_points: 4,
- fixed_version: backlog_version)
+ version: backlog_version)
end
let!(:default_status) do
FactoryBot.create(:default_status)
diff --git a/modules/backlogs/spec/features/onboarding/backlogs_onboarding_tour_spec.rb b/modules/backlogs/spec/features/onboarding/backlogs_onboarding_tour_spec.rb
index fdc27adbfd3..d31168ada45 100644
--- a/modules/backlogs/spec/features/onboarding/backlogs_onboarding_tour_spec.rb
+++ b/modules/backlogs/spec/features/onboarding/backlogs_onboarding_tour_spec.rb
@@ -51,7 +51,7 @@ describe 'backlogs onboarding tour', js: true do
let(:impediment) do
FactoryBot.build(:impediment, author: user,
- fixed_version: sprint,
+ version: sprint,
assigned_to: user,
project: project,
type: type_task,
@@ -74,7 +74,7 @@ describe 'backlogs onboarding tour', js: true do
priority: priority,
position: 1,
story_points: 3,
- fixed_version: sprint )
+ version: sprint )
end
before do
diff --git a/modules/backlogs/spec/models/backlog_spec.rb b/modules/backlogs/spec/models/backlog_spec.rb
index f74c8a63bd3..960501d0185 100644
--- a/modules/backlogs/spec/models/backlog_spec.rb
+++ b/modules/backlogs/spec/models/backlog_spec.rb
@@ -44,7 +44,7 @@ describe Backlog, type: :model do
before(:each) do
@project = project
@work_packages = [FactoryBot.create(:work_package, subject: 'work_package1', project: @project, type: @feature, status: @status)]
- @version = FactoryBot.create(:version, project: project, fixed_issues: @work_packages)
+ @version = FactoryBot.create(:version, project: project, work_packages: @work_packages)
@version_settings = @version.version_settings.create(display: VersionSetting::DISPLAY_RIGHT, project: project)
end
diff --git a/modules/backlogs/spec/models/burndown_spec.rb b/modules/backlogs/spec/models/burndown_spec.rb
index 5073108ec17..b5d3efe1db1 100644
--- a/modules/backlogs/spec/models/burndown_spec.rb
+++ b/modules/backlogs/spec/models/burndown_spec.rb
@@ -111,7 +111,7 @@ describe Burndown, type: :model do
before(:each) do
@story = FactoryBot.build(:story, subject: 'Story 1',
project: project,
- fixed_version: version,
+ version: version,
type: type_feature,
status: issue_open,
priority: issue_priority,
@@ -163,7 +163,7 @@ describe Burndown, type: :model do
(0..9).each do |i|
@stories[i] = FactoryBot.create(:story, subject: "Story #{i}",
project: project,
- fixed_version: version,
+ version: version,
type: type_feature,
status: issue_open,
priority: issue_priority,
diff --git a/modules/backlogs/spec/models/impediment_spec.rb b/modules/backlogs/spec/models/impediment_spec.rb
index 47646aa0fa2..e63bf94601f 100644
--- a/modules/backlogs/spec/models/impediment_spec.rb
+++ b/modules/backlogs/spec/models/impediment_spec.rb
@@ -63,7 +63,7 @@ describe Impediment, type: :model do
let(:impediment) {
FactoryBot.build(:impediment, author: user,
- fixed_version: version,
+ version: version,
assigned_to: user,
priority: issue_priority,
project: project,
@@ -108,9 +108,9 @@ describe Impediment, type: :model do
describe 'WITH only prior blockers defined' do
before(:each) do
- feature.fixed_version = version
+ feature.version = version
feature.save
- task.fixed_version = version
+ task.version = version
task.save
# Using the default association method block_ids (without s) here
diff --git a/modules/backlogs/spec/models/issue_position_spec.rb b/modules/backlogs/spec/models/issue_position_spec.rb
index 8d16bfd14dd..e79381374bb 100644
--- a/modules/backlogs/spec/models/issue_position_spec.rb
+++ b/modules/backlogs/spec/models/issue_position_spec.rb
@@ -31,7 +31,7 @@ require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
describe WorkPackage, type: :model do
describe 'Story positions' do
def build_work_package(options)
- FactoryBot.build(:work_package, options.reverse_merge(fixed_version_id: sprint_1.id,
+ FactoryBot.build(:work_package, options.reverse_merge(version_id: sprint_1.id,
priority_id: priority.id,
project_id: project.id,
status_id: status.id,
@@ -54,23 +54,23 @@ describe WorkPackage, type: :model do
let(:sprint_1) { FactoryBot.create(:version, project_id: project.id, name: 'Sprint 1') }
let(:sprint_2) { FactoryBot.create(:version, project_id: project.id, name: 'Sprint 2') }
- let(:work_package_1) { create_work_package(subject: 'WorkPackage 1', fixed_version_id: sprint_1.id) }
- let(:work_package_2) { create_work_package(subject: 'WorkPackage 2', fixed_version_id: sprint_1.id) }
- let(:work_package_3) { create_work_package(subject: 'WorkPackage 3', fixed_version_id: sprint_1.id) }
- let(:work_package_4) { create_work_package(subject: 'WorkPackage 4', fixed_version_id: sprint_1.id) }
- let(:work_package_5) { create_work_package(subject: 'WorkPackage 5', fixed_version_id: sprint_1.id) }
+ let(:work_package_1) { create_work_package(subject: 'WorkPackage 1', version_id: sprint_1.id) }
+ let(:work_package_2) { create_work_package(subject: 'WorkPackage 2', version_id: sprint_1.id) }
+ let(:work_package_3) { create_work_package(subject: 'WorkPackage 3', version_id: sprint_1.id) }
+ let(:work_package_4) { create_work_package(subject: 'WorkPackage 4', version_id: sprint_1.id) }
+ let(:work_package_5) { create_work_package(subject: 'WorkPackage 5', version_id: sprint_1.id) }
- let(:work_package_a) { create_work_package(subject: 'WorkPackage a', fixed_version_id: sprint_2.id) }
- let(:work_package_b) { create_work_package(subject: 'WorkPackage b', fixed_version_id: sprint_2.id) }
- let(:work_package_c) { create_work_package(subject: 'WorkPackage c', fixed_version_id: sprint_2.id) }
+ let(:work_package_a) { create_work_package(subject: 'WorkPackage a', version_id: sprint_2.id) }
+ let(:work_package_b) { create_work_package(subject: 'WorkPackage b', version_id: sprint_2.id) }
+ let(:work_package_c) { create_work_package(subject: 'WorkPackage c', version_id: sprint_2.id) }
let(:feedback_1) {
- create_work_package(subject: 'Feedback 1', fixed_version_id: sprint_1.id,
+ create_work_package(subject: 'Feedback 1', version_id: sprint_1.id,
type_id: other_type.id)
}
let(:task_1) {
- create_work_package(subject: 'Task 1', fixed_version_id: sprint_1.id,
+ create_work_package(subject: 'Task 1', version_id: sprint_1.id,
type_id: task_type.id)
}
@@ -111,14 +111,14 @@ describe WorkPackage, type: :model do
describe '- Creating a work_package in a sprint' do
it 'adds it to the bottom of the list' do
- new_work_package = create_work_package(subject: 'Newest WorkPackage', fixed_version_id: sprint_1.id)
+ new_work_package = create_work_package(subject: 'Newest WorkPackage', version_id: sprint_1.id)
expect(new_work_package).not_to be_new_record
expect(new_work_package).to be_last
end
it 'does not reorder the existing work_packages' do
- new_work_package = create_work_package(subject: 'Newest WorkPackage', fixed_version_id: sprint_1.id)
+ new_work_package = create_work_package(subject: 'Newest WorkPackage', version_id: sprint_1.id)
expect([work_package_1, work_package_2, work_package_3, work_package_4, work_package_5].each(&:reload).map(&:position)).to eq([1, 2, 3, 4, 5])
end
@@ -126,24 +126,24 @@ describe WorkPackage, type: :model do
describe '- Removing a work_package from the sprint' do
it 'reorders the remaining work_packages' do
- work_package_2.fixed_version = sprint_2
+ work_package_2.version = sprint_2
work_package_2.save!
- expect(sprint_1.fixed_issues.order(Arel.sql('id'))).to eq([work_package_1, work_package_3, work_package_4, work_package_5])
- expect(sprint_1.fixed_issues.order(Arel.sql('id')).each(&:reload).map(&:position)).to eq([1, 2, 3, 4])
+ expect(sprint_1.work_packages.order(Arel.sql('id'))).to eq([work_package_1, work_package_3, work_package_4, work_package_5])
+ expect(sprint_1.work_packages.order(Arel.sql('id')).each(&:reload).map(&:position)).to eq([1, 2, 3, 4])
end
end
describe '- Adding a work_package to a sprint' do
it 'adds it to the bottom of the list' do
- work_package_a.fixed_version = sprint_1
+ work_package_a.version = sprint_1
work_package_a.save!
expect(work_package_a).to be_last
end
it 'does not reorder the existing work_packages' do
- work_package_a.fixed_version = sprint_1
+ work_package_a.version = sprint_1
work_package_a.save!
expect([work_package_1, work_package_2, work_package_3, work_package_4, work_package_5].each(&:reload).map(&:position)).to eq([1, 2, 3, 4, 5])
@@ -235,8 +235,8 @@ describe WorkPackage, type: :model do
describe '- Moving work_packages between projects' do
# N.B.: You cannot move a ticket to another project and change the
- # 'fixed_version' at the same time. On the other hand, OpenProject tries
- # to keep the 'fixed_version' if possible (e.g. within project
+ # 'version' at the same time. On the other hand, OpenProject tries
+ # to keep the 'version' if possible (e.g. within project
# hierarchies with shared versions)
let(:project_wo_backlogs) { FactoryBot.create(:project) }
@@ -276,22 +276,22 @@ describe WorkPackage, type: :model do
end
describe '- Moving an work_package from a project without backlogs to a backlogs_enabled project' do
- describe 'if the fixed_version may not be kept' do
+ describe 'if the version may not be kept' do
let(:work_package_i) {
create_work_package(subject: 'WorkPackage I',
- fixed_version_id: version_go_live.id,
+ version_id: version_go_live.id,
project_id: project_wo_backlogs.id)
}
before do
work_package_i
end
- it 'sets the fixed_version_id to nil' do
+ it 'sets the version_id to nil' do
result = move_to_project(work_package_i, project)
expect(result).to be_truthy
- expect(work_package_i.fixed_version).to be_nil
+ expect(work_package_i.version).to be_nil
end
it 'removes it from any list' do
@@ -303,10 +303,10 @@ describe WorkPackage, type: :model do
end
end
- describe 'if the fixed_version may be kept' do
+ describe 'if the version may be kept' do
let(:work_package_i) {
create_work_package(subject: 'WorkPackage I',
- fixed_version_id: shared_sprint.id,
+ version_id: shared_sprint.id,
project_id: sub_project_wo_backlogs.id)
}
@@ -314,12 +314,12 @@ describe WorkPackage, type: :model do
work_package_i
end
- it 'keeps the fixed_version_id' do
+ it 'keeps the version_id' do
result = move_to_project(work_package_i, project)
expect(result).to be_truthy
- expect(work_package_i.fixed_version).to eq(shared_sprint)
+ expect(work_package_i.version).to eq(shared_sprint)
end
it 'adds it to the bottom of the list' do
@@ -333,13 +333,13 @@ describe WorkPackage, type: :model do
end
describe '- Moving an work_package away from backlogs_enabled project to a project without backlogs' do
- describe 'if the fixed_version may not be kept' do
- it 'sets the fixed_version_id to nil' do
+ describe 'if the version may not be kept' do
+ it 'sets the version_id to nil' do
result = move_to_project(work_package_3, project_wo_backlogs)
expect(result).to be_truthy
- expect(work_package_3.fixed_version).to be_nil
+ expect(work_package_3.version).to be_nil
end
it 'removes it from any list' do
@@ -359,18 +359,18 @@ describe WorkPackage, type: :model do
end
end
- describe 'if the fixed_version may be kept' do
+ describe 'if the version may be kept' do
let(:work_package_i) {
create_work_package(subject: 'WorkPackage I',
- fixed_version_id: shared_sprint.id)
+ version_id: shared_sprint.id)
}
let(:work_package_ii) {
create_work_package(subject: 'WorkPackage II',
- fixed_version_id: shared_sprint.id)
+ version_id: shared_sprint.id)
}
let(:work_package_iii) {
create_work_package(subject: 'WorkPackage III',
- fixed_version_id: shared_sprint.id)
+ version_id: shared_sprint.id)
}
before do
@@ -381,12 +381,12 @@ describe WorkPackage, type: :model do
expect([work_package_i, work_package_ii, work_package_iii].map(&:position)).to eq([1, 2, 3])
end
- it 'keeps the fixed_version_id' do
+ it 'keeps the version_id' do
result = move_to_project(work_package_ii, sub_project_wo_backlogs)
expect(result).to be_truthy
- expect(work_package_ii.fixed_version).to eq(shared_sprint)
+ expect(work_package_ii.version).to eq(shared_sprint)
end
it 'removes it from any list' do
diff --git a/modules/backlogs/spec/models/story_spec.rb b/modules/backlogs/spec/models/story_spec.rb
index 738bd41e86b..7be47e966f9 100644
--- a/modules/backlogs/spec/models/story_spec.rb
+++ b/modules/backlogs/spec/models/story_spec.rb
@@ -39,14 +39,14 @@ describe Story, type: :model do
let(:issue_priority) { @issue_priority ||= FactoryBot.create(:priority) }
let(:task_type) { FactoryBot.create(:type_task) }
let(:task) {
- FactoryBot.create(:story, fixed_version: version,
+ FactoryBot.create(:story, version: version,
project: project,
status: status1,
type: task_type,
priority: issue_priority)
}
let(:story1) {
- FactoryBot.create(:story, fixed_version: version,
+ FactoryBot.create(:story, version: version,
project: project,
status: status1,
type: type_feature,
@@ -54,7 +54,7 @@ describe Story, type: :model do
}
let(:story2) {
- FactoryBot.create(:story, fixed_version: version,
+ FactoryBot.create(:story, version: version,
project: project,
status: status1,
type: type_feature,
@@ -100,7 +100,7 @@ describe Story, type: :model do
before do
version2
story1
- story2.fixed_version_id = version2.id
+ story2.version_id = version2.id
story2.save!
end
@@ -116,7 +116,7 @@ describe Story, type: :model do
version2
story1
- story2.fixed_version_id = version2.id
+ story2.version_id = version2.id
story2.save!
end
@@ -135,7 +135,7 @@ describe Story, type: :model do
other_project = FactoryBot.create(:project)
version2.update! project_id: other_project.id
- story2.fixed_version_id = version2.id
+ story2.version_id = version2.id
story2.project = other_project
# reset memoized versions to reflect changes above
story2.instance_variable_set('@assignable_versions', nil)
diff --git a/modules/backlogs/spec/models/version_spec.rb b/modules/backlogs/spec/models/version_spec.rb
index a47caa6709c..ab687c7df46 100644
--- a/modules/backlogs/spec/models/version_spec.rb
+++ b/modules/backlogs/spec/models/version_spec.rb
@@ -33,7 +33,7 @@ describe Version, type: :model do
describe 'rebuild positions' do
def build_work_package(options = {})
- FactoryBot.build(:work_package, options.reverse_merge(fixed_version_id: version.id,
+ FactoryBot.build(:work_package, options.reverse_merge(version_id: version.id,
priority_id: priority.id,
project_id: project.id,
status_id: status.id))
@@ -96,7 +96,7 @@ describe Version, type: :model do
work_package3 = FactoryBot.create(:work_package, parent_id: work_package2.id, type_id: task_type.id, status_id: status.id, project_id: project.id)
work_package1.reload
- work_package1.fixed_version_id = version.id
+ work_package1.version_id = version.id
work_package1.save!
work_package1.reload
@@ -119,9 +119,9 @@ describe Version, type: :model do
expect(work_package2.project).to eq(project2)
expect(work_package1.project).to eq(project)
- expect(work_package3.fixed_version_id).to be_nil
- expect(work_package2.fixed_version_id).to be_nil
- expect(work_package1.fixed_version_id).to eq(version.id)
+ expect(work_package3.version_id).to be_nil
+ expect(work_package2.version_id).to be_nil
+ expect(work_package1.version_id).to eq(version.id)
end
it 'rebuilds postions' do
@@ -145,7 +145,7 @@ describe Version, type: :model do
version.rebuild_positions(project)
work_packages = version
- .fixed_issues
+ .work_packages
.where(project_id: project)
.order(Arel.sql('COALESCE(position, 0) ASC, id ASC'))
diff --git a/modules/backlogs/spec/services/impediments/create_services_spec.rb b/modules/backlogs/spec/services/impediments/create_services_spec.rb
index af6d525d3fb..f868a3c44f5 100644
--- a/modules/backlogs/spec/services/impediments/create_services_spec.rb
+++ b/modules/backlogs/spec/services/impediments/create_services_spec.rb
@@ -74,7 +74,7 @@ describe Impediments::CreateService do
it { expect(subject.subject).to eql impediment_subject }
it { expect(subject.author).to eql User.current }
it { expect(subject.project).to eql project }
- it { expect(subject.fixed_version).to eql version }
+ it { expect(subject.version).to eql version }
it { expect(subject.priority).to eql priority }
it { expect(subject.status).to eql status1 }
it { expect(subject.type).to eql type_task }
@@ -101,13 +101,13 @@ describe Impediments::CreateService do
priority_id: priority.id,
blocks_ids: feature.id.to_s,
status_id: status1.id,
- fixed_version_id: version.id,
+ version_id: version.id,
project_id: project.id })
call.result
end
before(:each) do
- feature.fixed_version = version
+ feature.version = version
feature.save
end
@@ -123,13 +123,13 @@ describe Impediments::CreateService do
priority_id: priority.id,
blocks_ids: feature.id.to_s,
status_id: status1.id,
- fixed_version_id: version.id,
+ version_id: version.id,
project_id: project.id })
call.result
end
before(:each) do
- feature.fixed_version = FactoryBot.create(:version, project: project, name: 'another version')
+ feature.version = FactoryBot.create(:version, project: project, name: 'another version')
feature.save
end
@@ -145,7 +145,7 @@ describe Impediments::CreateService do
priority_id: priority.id,
blocks_ids: '0',
status_id: status1.id,
- fixed_version_id: version.id,
+ version_id: version.id,
project_id: project.id })
call.result
end
@@ -163,7 +163,7 @@ describe Impediments::CreateService do
blocks_ids: '',
priority_id: priority.id,
status_id: status1.id,
- fixed_version_id: version.id,
+ version_id: version.id,
project_id: project.id })
call.result
end
diff --git a/modules/backlogs/spec/services/impediments/update_service_spec.rb b/modules/backlogs/spec/services/impediments/update_service_spec.rb
index 8e4b8c4ddf2..b0a8728b517 100644
--- a/modules/backlogs/spec/services/impediments/update_service_spec.rb
+++ b/modules/backlogs/spec/services/impediments/update_service_spec.rb
@@ -72,7 +72,7 @@ describe Impediments::UpdateService, type: :model do
}
let(:impediment) do
FactoryBot.build(:impediment, author: user,
- fixed_version: version,
+ version: version,
assigned_to: user,
project: project,
type: type_task,
@@ -92,7 +92,7 @@ describe Impediments::UpdateService, type: :model do
project.save
type_workflow.save
- feature.fixed_version = version
+ feature.version = version
feature.save
impediment.blocks_ids = feature.id.to_s
@@ -102,7 +102,7 @@ describe Impediments::UpdateService, type: :model do
shared_examples_for 'impediment update' do
it { expect(subject.author).to eql user }
it { expect(subject.project).to eql project }
- it { expect(subject.fixed_version).to eql version }
+ it { expect(subject.version).to eql version }
it { expect(subject.priority).to eql priority }
it { expect(subject.status).to eql status2 }
it { expect(subject.type).to eql type_task }
@@ -146,7 +146,7 @@ describe Impediments::UpdateService, type: :model do
let(:story_version) { version }
before(:each) do
- story.fixed_version = story_version
+ story.version = story_version
story.save!
end
diff --git a/modules/backlogs/spec/services/stories/create_service_spec.rb b/modules/backlogs/spec/services/stories/create_service_spec.rb
index 5260b9272b0..eb67a7c990c 100644
--- a/modules/backlogs/spec/services/stories/create_service_spec.rb
+++ b/modules/backlogs/spec/services/stories/create_service_spec.rb
@@ -71,7 +71,7 @@ describe Stories::CreateService, type: :model do
project.enabled_module_names += ['backlogs']
FactoryBot.create(:story,
- fixed_version: version,
+ version: version,
project: project,
status: status,
type: type_feature,
diff --git a/modules/backlogs/spec/services/work_packages/update_service_version_inheritance_spec.rb b/modules/backlogs/spec/services/work_packages/update_service_version_inheritance_spec.rb
index a4395e4c4a9..e506e61ea5c 100644
--- a/modules/backlogs/spec/services/work_packages/update_service_version_inheritance_spec.rb
+++ b/modules/backlogs/spec/services/work_packages/update_service_version_inheritance_spec.rb
@@ -59,7 +59,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
subject: 'Story',
project: project,
type: type_feature,
- fixed_version: version1,
+ version: version1,
status: status,
author: user,
priority: issue_priority)
@@ -71,7 +71,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
subject: 'Story2',
project: project,
type: type_feature,
- fixed_version: version1,
+ version: version1,
status: status,
author: user,
priority: issue_priority)
@@ -83,7 +83,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
subject: 'Story3',
project: project,
type: type_feature,
- fixed_version: version1,
+ version: version1,
status: status,
author: user,
priority: issue_priority)
@@ -94,7 +94,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
FactoryBot.build(:work_package,
subject: 'Task',
type: type_task,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -105,7 +105,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
FactoryBot.build(:work_package,
subject: 'Task2',
type: type_task,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -116,7 +116,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
FactoryBot.build(:work_package,
subject: 'Task3',
type: type_task,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -127,7 +127,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
FactoryBot.build(:work_package,
subject: 'Task4',
type: type_task,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -138,7 +138,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
FactoryBot.build(:work_package,
subject: 'Task5',
type: type_task,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -149,7 +149,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
FactoryBot.build(:work_package,
subject: 'Task6',
type: type_task,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -160,7 +160,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
FactoryBot.build(:work_package,
subject: 'Bug',
type: type_bug,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -171,7 +171,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
FactoryBot.build(:work_package,
subject: 'Bug2',
type: type_bug,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -182,7 +182,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
FactoryBot.build(:work_package,
subject: 'Bug3',
type: type_bug,
- fixed_version: version1,
+ version: version1,
project: project,
status: status,
author: user,
@@ -225,11 +225,11 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
child.reload
end
- describe 'WHEN changing fixed_version' do
+ describe 'WHEN changing version' do
let(:instance) { described_class.new(user: user, model: parent) }
- shared_examples_for "changing parent's fixed_version changes child's fixed version" do
- it "SHOULD change the child's fixed version to the parent's fixed version" do
+ shared_examples_for "changing parent's version changes child's version" do
+ it "SHOULD change the child's version to the parent's version" do
parent.save!
child.parent_id = parent.id
child.save!
@@ -238,20 +238,20 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
parent.reload
- instance.call(fixed_version: version2)
+ instance.call(version: version2)
# Because of performance, these assertions are all in one it statement
- expect(child.reload.fixed_version).to eql version2
- expect(task3.reload.fixed_version).to eql version2
- expect(task4.reload.fixed_version).to eql version2
- expect(bug3.reload.fixed_version).to eql version1
- expect(story3.reload.fixed_version).to eql version1
- expect(task5.reload.fixed_version).to eql version1
- expect(task6.reload.fixed_version).to eql version1
+ expect(child.reload.version).to eql version2
+ expect(task3.reload.version).to eql version2
+ expect(task4.reload.version).to eql version2
+ expect(bug3.reload.version).to eql version1
+ expect(story3.reload.version).to eql version1
+ expect(task5.reload.version).to eql version1
+ expect(task6.reload.version).to eql version1
end
end
- shared_examples_for "changing parent's fixed_version does not change child's fixed_version" do
+ shared_examples_for "changing parent's version does not change child's version" do
it "SHOULD keep the child's version" do
parent.save!
child.parent_id = parent.id
@@ -261,16 +261,16 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
parent.reload
- instance.call(fixed_version: version2)
+ instance.call(version: version2)
# Because of performance, these assertions are all in one it statement
- expect(child.reload.fixed_version).to eql version1
- expect(task3.reload.fixed_version).to eql version1
- expect(task4.reload.fixed_version).to eql version1
- expect(bug3.reload.fixed_version).to eql version1
- expect(story3.reload.fixed_version).to eql version1
- expect(task5.reload.fixed_version).to eql version1
- expect(task6.reload.fixed_version).to eql version1
+ expect(child.reload.version).to eql version1
+ expect(task3.reload.version).to eql version1
+ expect(task4.reload.version).to eql version1
+ expect(bug3.reload.version).to eql version1
+ expect(story3.reload.version).to eql version1
+ expect(task5.reload.version).to eql version1
+ expect(task6.reload.version).to eql version1
end
end
@@ -285,19 +285,19 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
describe 'WITH a task as child' do
let(:child) { task2 }
- it_should_behave_like "changing parent's fixed_version changes child's fixed version"
+ it_should_behave_like "changing parent's version changes child's version"
end
describe 'WITH a non backlogs work_package as child' do
let(:child) { bug2 }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
describe 'WITH a story as a child' do
let(:child) { story2 }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
end
@@ -307,13 +307,13 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
describe 'WITH a task as child' do
let(:child) { task2 }
- it_should_behave_like "changing parent's fixed_version changes child's fixed version"
+ it_should_behave_like "changing parent's version changes child's version"
end
describe 'WITH a non backlogs work_package as child' do
let(:child) { bug }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
end
@@ -323,19 +323,19 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
describe 'WITH a task as child' do
let(:child) { task }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
describe 'WITH a non backlogs work_package as child' do
let(:child) { bug2 }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
describe 'WITH a story as a child' do
let(:child) { story }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
end
end
@@ -351,19 +351,19 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
describe 'WITH a task as child' do
let(:child) { task2 }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
describe 'WITH a non backlogs work_package as child' do
let(:child) { bug2 }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
describe 'WITH a story as a child' do
let(:child) { story2 }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
end
@@ -379,13 +379,13 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
describe 'WITH a task as child' do
let(:child) { task2 }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
describe 'WITH a non backlogs work_package as child' do
let(:child) { bug }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
end
@@ -395,13 +395,13 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
describe 'WITH a task as child' do
let(:child) { task2 }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
describe 'WITH a non backlogs work_package as child' do
let(:child) { bug }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
end
@@ -411,19 +411,19 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
describe 'WITH a task as child' do
let(:child) { task }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
describe 'WITH a non backlogs work_package as child' do
let(:child) { bug2 }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
describe 'WITH a story as a child' do
let(:child) { story }
- it_should_behave_like "changing parent's fixed_version does not change child's fixed_version"
+ it_should_behave_like "changing parent's version does not change child's version"
end
end
end
@@ -432,45 +432,45 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
describe 'WHEN changing the parent_id' do
let(:instance) { described_class.new(user: user, model: child) }
- shared_examples_for "changing the child's parent_issue to the parent changes child's fixed version" do
- it "SHOULD change the child's fixed version to the parent's fixed version" do
+ shared_examples_for "changing the child's parent_issue to the parent changes child's version" do
+ it "SHOULD change the child's version to the parent's version" do
child.save!
standard_child_layout
- parent.fixed_version = version2
+ parent.version = version2
parent.save!
instance.call(parent_id: parent.id)
# Because of performance, these assertions are all in one it statement
- expect(child.reload.fixed_version).to eql version2
- expect(task3.reload.fixed_version).to eql version2
- expect(task4.reload.fixed_version).to eql version2
- expect(bug3.reload.fixed_version).to eql version1
- expect(story3.reload.fixed_version).to eql version1
- expect(task5.reload.fixed_version).to eql version1
- expect(task6.reload.fixed_version).to eql version1
+ expect(child.reload.version).to eql version2
+ expect(task3.reload.version).to eql version2
+ expect(task4.reload.version).to eql version2
+ expect(bug3.reload.version).to eql version1
+ expect(story3.reload.version).to eql version1
+ expect(task5.reload.version).to eql version1
+ expect(task6.reload.version).to eql version1
end
end
- shared_examples_for "changing the child's parent to the parent leaves child's fixed version" do
+ shared_examples_for "changing the child's parent to the parent leaves child's version" do
it "SHOULD keep the child's version" do
child.save!
standard_child_layout
- parent.fixed_version = version2
+ parent.version = version2
parent.save!
instance.call(parent_id: parent.id)
# Because of performance, these assertions are all in one it statement
- expect(child.reload.fixed_version).to eql version1
- expect(task3.reload.fixed_version).to eql version1
- expect(task4.reload.fixed_version).to eql version1
- expect(bug3.reload.fixed_version).to eql version1
- expect(story3.reload.fixed_version).to eql version1
- expect(task5.reload.fixed_version).to eql version1
- expect(task6.reload.fixed_version).to eql version1
+ expect(child.reload.version).to eql version1
+ expect(task3.reload.version).to eql version1
+ expect(task4.reload.version).to eql version1
+ expect(bug3.reload.version).to eql version1
+ expect(story3.reload.version).to eql version1
+ expect(task5.reload.version).to eql version1
+ expect(task6.reload.version).to eql version1
end
end
@@ -485,19 +485,19 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
describe 'WITH a story as child' do
let(:child) { story2 }
- it_should_behave_like "changing the child's parent to the parent leaves child's fixed version"
+ it_should_behave_like "changing the child's parent to the parent leaves child's version"
end
describe 'WITH a task as child' do
let(:child) { task2 }
- it_should_behave_like "changing the child's parent_issue to the parent changes child's fixed version"
+ it_should_behave_like "changing the child's parent_issue to the parent changes child's version"
end
describe 'WITH a non-backlogs work_package as child' do
let(:child) { bug2 }
- it_should_behave_like "changing the child's parent to the parent leaves child's fixed version"
+ it_should_behave_like "changing the child's parent to the parent leaves child's version"
end
end
@@ -513,7 +513,7 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
let(:parent) { story }
let(:child) { task2 }
- it_should_behave_like "changing the child's parent_issue to the parent changes child's fixed version"
+ it_should_behave_like "changing the child's parent_issue to the parent changes child's version"
end
describe 'WITH a task as parent' do
@@ -526,19 +526,19 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
end
# Needs to be the story because it is not possible to change a task's
- # 'fixed_version_id'
+ # 'version_id'
let(:parent) { story }
describe 'WITH a task as child' do
let(:child) { task2 }
- it_should_behave_like "changing the child's parent_issue to the parent changes child's fixed version"
+ it_should_behave_like "changing the child's parent_issue to the parent changes child's version"
end
describe 'WITH a non-backlogs work_package as child' do
let(:child) { bug2 }
- it_should_behave_like "changing the child's parent to the parent leaves child's fixed version"
+ it_should_behave_like "changing the child's parent to the parent leaves child's version"
end
end
@@ -548,13 +548,13 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
describe 'WITH a task as child' do
let(:child) { task2 }
- it_should_behave_like "changing the child's parent_issue to the parent changes child's fixed version"
+ it_should_behave_like "changing the child's parent_issue to the parent changes child's version"
end
describe 'WITH a non-backlogs work_package as child' do
let(:child) { bug2 }
- it_should_behave_like "changing the child's parent to the parent leaves child's fixed version"
+ it_should_behave_like "changing the child's parent to the parent leaves child's version"
end
end
@@ -564,19 +564,19 @@ describe WorkPackages::UpdateService, "version inheritance", type: :model do
describe 'WITH a story as child' do
let(:child) { story2 }
- it_should_behave_like "changing the child's parent to the parent leaves child's fixed version"
+ it_should_behave_like "changing the child's parent to the parent leaves child's version"
end
describe 'WITH a task as child' do
let(:child) { task2 }
- it_should_behave_like "changing the child's parent to the parent leaves child's fixed version"
+ it_should_behave_like "changing the child's parent to the parent leaves child's version"
end
describe 'WITH a non-backlogs work_package as child' do
let(:child) { bug2 }
- it_should_behave_like "changing the child's parent to the parent leaves child's fixed version"
+ it_should_behave_like "changing the child's parent to the parent leaves child's version"
end
end
end
diff --git a/modules/backlogs/spec/views/rb_burndown_charts/show_spec.rb b/modules/backlogs/spec/views/rb_burndown_charts/show_spec.rb
index f5e353ffaef..eb9aa961dd1 100644
--- a/modules/backlogs/spec/views/rb_burndown_charts/show_spec.rb
+++ b/modules/backlogs/spec/views/rb_burndown_charts/show_spec.rb
@@ -57,7 +57,7 @@ describe 'rb_burndown_charts/show', type: :view do
FactoryBot.create(:story, status: statuses[0],
project: project,
type: type_feature,
- fixed_version: sprint,
+ version: sprint,
priority: issue_priority
)
}
@@ -65,7 +65,7 @@ describe 'rb_burndown_charts/show', type: :view do
FactoryBot.create(:story, status: statuses[1],
project: project,
type: type_feature,
- fixed_version: sprint,
+ version: sprint,
priority: issue_priority
)
}
@@ -73,14 +73,14 @@ describe 'rb_burndown_charts/show', type: :view do
FactoryBot.create(:story, status: statuses[2],
project: project,
type: type_feature,
- fixed_version: sprint,
+ version: sprint,
priority: issue_priority
)
}
let(:stories) { [story_a, story_b, story_c] }
let(:sprint) { FactoryBot.create(:sprint, project: project, start_date: Date.today - 1.week, effective_date: Date.today + 1.week) }
let(:task) do
- task = FactoryBot.create(:task, project: project, status: statuses[0], fixed_version: sprint, type: type_task)
+ task = FactoryBot.create(:task, project: project, status: statuses[0], version: sprint, type: type_task)
# This is necessary as for some unknown reason passing the parent directly
# leads to the task searching for the parent with 'root_id' is NULL, which
# is not the case as the story has its own id as root_id
diff --git a/modules/backlogs/spec/views/rb_master_backlogs/index.html.erb_spec.rb b/modules/backlogs/spec/views/rb_master_backlogs/index.html.erb_spec.rb
index 89411cebeb4..a58d01fef7b 100644
--- a/modules/backlogs/spec/views/rb_master_backlogs/index.html.erb_spec.rb
+++ b/modules/backlogs/spec/views/rb_master_backlogs/index.html.erb_spec.rb
@@ -51,7 +51,7 @@ describe 'rb_master_backlogs/index', type: :view do
FactoryBot.create(:story, status: statuses[0],
project: project,
type: type_feature,
- fixed_version: sprint,
+ version: sprint,
priority: issue_priority
)
}
@@ -59,7 +59,7 @@ describe 'rb_master_backlogs/index', type: :view do
FactoryBot.create(:story, status: statuses[1],
project: project,
type: type_feature,
- fixed_version: sprint,
+ version: sprint,
priority: issue_priority
)
}
@@ -67,7 +67,7 @@ describe 'rb_master_backlogs/index', type: :view do
FactoryBot.create(:story, status: statuses[2],
project: project,
type: type_feature,
- fixed_version: sprint,
+ version: sprint,
priority: issue_priority
)
}
diff --git a/modules/backlogs/spec/views/rb_taskboards/show_spec.rb b/modules/backlogs/spec/views/rb_taskboards/show_spec.rb
index 9e5f779b207..cb9eafa8735 100644
--- a/modules/backlogs/spec/views/rb_taskboards/show_spec.rb
+++ b/modules/backlogs/spec/views/rb_taskboards/show_spec.rb
@@ -57,7 +57,7 @@ describe 'rb_taskboards/show', type: :view do
FactoryBot.create(:story, status: statuses[0],
project: project,
type: type_feature,
- fixed_version: sprint,
+ version: sprint,
priority: issue_priority
)
}
@@ -65,7 +65,7 @@ describe 'rb_taskboards/show', type: :view do
FactoryBot.create(:story, status: statuses[1],
project: project,
type: type_feature,
- fixed_version: sprint,
+ version: sprint,
priority: issue_priority
)
}
@@ -73,21 +73,21 @@ describe 'rb_taskboards/show', type: :view do
FactoryBot.create(:story, status: statuses[2],
project: project,
type: type_feature,
- fixed_version: sprint,
+ version: sprint,
priority: issue_priority
)
}
let(:stories) { [story_a, story_b, story_c] }
let(:sprint) { FactoryBot.create(:sprint, project: project) }
let(:task) do
- task = FactoryBot.create(:task, project: project, status: statuses[0], fixed_version: sprint, type: type_task)
+ task = FactoryBot.create(:task, project: project, status: statuses[0], version: sprint, type: type_task)
# This is necessary as for some unknown reason passing the parent directly
# leads to the task searching for the parent with 'root_id' is NULL, which
# is not the case as the story has its own id as root_id
task.parent_id = story_a.id
task
end
- let(:impediment) { FactoryBot.create(:impediment, project: project, status: statuses[0], fixed_version: sprint, blocks_ids: task.id.to_s, type: type_task) }
+ let(:impediment) { FactoryBot.create(:impediment, project: project, status: statuses[0], version: sprint, blocks_ids: task.id.to_s, type: type_task) }
before :each do
allow(Setting).to receive(:plugin_openproject_backlogs).and_return({ 'story_types' => [type_feature.id], 'task_type' => type_task.id })
diff --git a/modules/boards/spec/features/action_boards/version_board_spec.rb b/modules/boards/spec/features/action_boards/version_board_spec.rb
index 97c421b12cc..8d32c8cb253 100644
--- a/modules/boards/spec/features/action_boards/version_board_spec.rb
+++ b/modules/boards/spec/features/action_boards/version_board_spec.rb
@@ -66,8 +66,8 @@ describe 'Version action board', type: :feature, js: true do
let!(:shared_version) { FactoryBot.create :version, project: second_project, name: 'Shared version', sharing: 'system' }
let!(:closed_version) { FactoryBot.create :version, project: project, status: 'closed', name: 'Closed version' }
- let!(:work_package) { FactoryBot.create :work_package, project: project, subject: 'Foo', fixed_version: open_version }
- let!(:closed_version_wp) { FactoryBot.create :work_package, project: project, subject: 'Closed', fixed_version: closed_version }
+ let!(:work_package) { FactoryBot.create :work_package, project: project, subject: 'Foo', version: open_version }
+ let!(:closed_version_wp) { FactoryBot.create :work_package, project: project, subject: 'Closed', version: closed_version }
let(:filters) { ::Components::WorkPackages::Filters.new }
def create_new_version_board
@@ -115,10 +115,10 @@ describe 'Version action board', type: :feature, js: true do
expect(open.name).to eq 'Open version'
expect(second_open.name).to eq 'A second version'
- expect(open.filters.first.name).to eq :fixed_version_id
+ expect(open.filters.first.name).to eq :version_id
expect(open.filters.first.values).to eq [open_version.id.to_s]
- expect(second_open.filters.first.name).to eq :fixed_version_id
+ expect(second_open.filters.first.name).to eq :version_id
expect(second_open.filters.first.values).to eq [other_version.id.to_s]
end
@@ -136,7 +136,7 @@ describe 'Version action board', type: :feature, js: true do
expect(second.ordered_work_packages).to be_empty
# Expect work package to be saved in query first
- subjects = WorkPackage.where(id: first.ordered_work_packages.pluck(:work_package_id)).pluck(:subject, :fixed_version_id)
+ subjects = WorkPackage.where(id: first.ordered_work_packages.pluck(:work_package_id)).pluck(:subject, :version_id)
# Only the explicitly added item is now contained in sort order
expect(subjects).to match_array [['Task 1', open_version.id]]
@@ -152,7 +152,7 @@ describe 'Version action board', type: :feature, js: true do
expect(second.reload.ordered_work_packages.count).to eq(1)
end
- subjects = WorkPackage.where(id: second.ordered_work_packages.pluck(:work_package_id)).pluck(:subject, :fixed_version_id)
+ subjects = WorkPackage.where(id: second.ordered_work_packages.pluck(:work_package_id)).pluck(:subject, :version_id)
expect(subjects).to match_array [['Task 1', other_version.id]]
# Expect that version is not available for global filter selection
@@ -202,7 +202,7 @@ describe 'Version action board', type: :feature, js: true do
board_page.expect_card('Open version', 'Foo', present: false)
board_page.expect_card('A second version', 'Task 1', present: true)
- subjects = WorkPackage.where(id: second.ordered_work_packages.pluck(:work_package_id)).pluck(:subject, :fixed_version_id)
+ subjects = WorkPackage.where(id: second.ordered_work_packages.pluck(:work_package_id)).pluck(:subject, :version_id)
expect(subjects).to match_array [['Task 1', other_version.id]]
end
@@ -271,7 +271,7 @@ describe 'Version action board', type: :feature, js: true do
expect(ids).to match_array [work_package.id, closed_version_wp.id]
closed_version_wp.reload
- expect(closed_version_wp.fixed_version_id).to eq(open_version.id)
+ expect(closed_version_wp.version_id).to eq(open_version.id)
# But we can not move back to closed
board_page.move_card(0, from: 'Open version', to: 'Closed version')
diff --git a/modules/boards/spec/features/board_reference_work_package_spec.rb b/modules/boards/spec/features/board_reference_work_package_spec.rb
index 82c7e0e06b8..fbffdbc6883 100644
--- a/modules/boards/spec/features/board_reference_work_package_spec.rb
+++ b/modules/boards/spec/features/board_reference_work_package_spec.rb
@@ -38,7 +38,7 @@ describe 'Board reference work package spec', type: :feature, js: true do
end
let(:project) { FactoryBot.create(:project, enabled_module_names: %i[work_package_tracking board_view]) }
let(:role) { FactoryBot.create(:role, permissions: permissions) }
- let!(:work_package) { FactoryBot.create :work_package, fixed_version: version, subject: 'Foo', project: project }
+ let!(:work_package) { FactoryBot.create :work_package, version: version, subject: 'Foo', project: project }
let(:board_index) { Pages::BoardIndex.new(project) }
let(:filters) { ::Components::WorkPackages::Filters.new }
@@ -91,7 +91,7 @@ describe 'Board reference work package spec', type: :feature, js: true do
# Reload work package expect version to be applied by filter
work_package.reload
- expect(work_package.fixed_version_id).to eq version.id
+ expect(work_package.version_id).to eq version.id
end
context 'with a subproject and work packages within it (Regression #31613)' do
diff --git a/modules/costs/db/migrate/20200327074416_rename_fixed_version_in_cost_query.rb b/modules/costs/db/migrate/20200327074416_rename_fixed_version_in_cost_query.rb
new file mode 100644
index 00000000000..09b4c617ccd
--- /dev/null
+++ b/modules/costs/db/migrate/20200327074416_rename_fixed_version_in_cost_query.rb
@@ -0,0 +1,25 @@
+class RenameFixedVersionInCostQuery < ActiveRecord::Migration[6.0]
+ def up
+ rename_query_attributes('FixedVersion', 'Version')
+ end
+
+ def down
+ rename_query_attributes('Version', 'FixedVersion')
+ end
+
+ def rename_query_attributes(from, to)
+ ActiveRecord::Base.connection.exec_query(
+ <<-SQL
+ UPDATE
+ cost_queries q_sink
+ SET
+ serialized = regexp_replace(q_source.serialized, '(\n- - )#{from}Id(\n)', '\1#{to}Id\2')
+ FROM
+ cost_queries q_source
+ WHERE
+ q_source.serialized LIKE '%#{from}%'
+ AND q_sink.id = q_source.id
+ SQL
+ )
+ end
+end
diff --git a/modules/documents/app/views/help/wiki_syntax_detailed.html.erb b/modules/documents/app/views/help/wiki_syntax_detailed.html.erb
index 31134024d9e..4a33988e97d 100644
--- a/modules/documents/app/views/help/wiki_syntax_detailed.html.erb
+++ b/modules/documents/app/views/help/wiki_syntax_detailed.html.erb
@@ -67,7 +67,7 @@ See docs/COPYRIGHT.rdoc for more details.
<p>OpenProject allows hyperlinking between issues, changesets and wiki pages from anywhere wiki formatting is used.</p>
<ul>
- <li><strong>#124</strong> displays a link to an issue: <del><a href="#" class="issue" title="bulk edit doesn't change the category or fixed version properties (Closed)">#124</a></del> (link is striked-through if the issue is closed)</li>
+ <li><strong>#124</strong> displays a link to an issue: <del><a href="#" class="issue" title="bulk edit doesn't change the category or version properties (Closed)">#124</a></del> (link is striked-through if the issue is closed)</li>
<li><strong>##124</strong> displays a link to an issue with context information: <a href="/issues/12" class="issue status-1 priority-2 overdue created-by-me" title="Issue subject (New)">#12 New: Issue subject</a> 2012-05-14 - 2012-05-23 (User Name - assigned to)</li>
<li><strong>###124</strong> displays a link to an issue with context information and an excerpt (first 3 lines) of the description</li>
<li><strong>r758</strong> displays a link to a changeset: <a href="#" class="changeset" title="Search engine now only searches objects the user is allowed to view.">r758</a></li>
diff --git a/modules/meeting/app/views/meeting_contents/history.html.erb b/modules/meeting/app/views/meeting_contents/history.html.erb
index e1934593c7e..07233ba451f 100644
--- a/modules/meeting/app/views/meeting_contents/history.html.erb
+++ b/modules/meeting/app/views/meeting_contents/history.html.erb
@@ -100,7 +100,7 @@ See docs/COPYRIGHT.rdoc for more details.
<% @content_versions.each_with_index do |content_version,index| %>
<tr>
<td class="id -short">
- <%= content_version.version == @content.version ?
+ <%= content_version.version == @content.current_journal.version ?
link_to(content_version.version, tab_meeting_path(@meeting, :tab => @content_type.sub(/^meeting_/, '')), id: "version-#{content_version.version}") :
link_to(content_version.version, send(:"#{@content_type}_version_path", @meeting, content_version.version), id: "version-#{content_version.version}") %>
</td>
diff --git a/modules/reporting/app/helpers/reporting_helper.rb b/modules/reporting/app/helpers/reporting_helper.rb
index 5cf4763e616..359c9fa7e39 100644
--- a/modules/reporting/app/helpers/reporting_helper.rb
+++ b/modules/reporting/app/helpers/reporting_helper.rb
@@ -113,7 +113,7 @@ module ReportingHelper
when :type_id then h(Type.find(value.to_i).name)
when :week then "#{l(:label_week)} #%s" % value.to_i.modulo(100)
when :priority_id then h(IssuePriority.find(value.to_i).name)
- when :fixed_version_id then h(Version.find(value.to_i).name)
+ when :version_id then h(Version.find(value.to_i).name)
when :singleton_value then ''
when :status_id then h(Status.find(value.to_i).name)
when /custom_field\d+/ then CustomOption.find_by(id: value)&.value || value.to_s
diff --git a/modules/reporting/app/models/cost_query/filter.rb b/modules/reporting/app/models/cost_query/filter.rb
index e2b65200a9e..13245c04ff7 100644
--- a/modules/reporting/app/models/cost_query/filter.rb
+++ b/modules/reporting/app/models/cost_query/filter.rb
@@ -38,7 +38,7 @@ class CostQuery::Filter < Report::Filter
CostQuery::Filter::CostTypeId,
CostQuery::Filter::CreatedOn,
CostQuery::Filter::DueDate,
- CostQuery::Filter::FixedVersionId,
+ CostQuery::Filter::VersionId,
CostQuery::Filter::WorkPackageId,
CostQuery::Filter::OverriddenCosts,
CostQuery::Filter::PriorityId,
diff --git a/modules/reporting/app/models/cost_query/filter/fixed_version_id.rb b/modules/reporting/app/models/cost_query/filter/version_id.rb
similarity index 93%
rename from modules/reporting/app/models/cost_query/filter/fixed_version_id.rb
rename to modules/reporting/app/models/cost_query/filter/version_id.rb
index 4cfcdaa2901..e352038c0bb 100644
--- a/modules/reporting/app/models/cost_query/filter/fixed_version_id.rb
+++ b/modules/reporting/app/models/cost_query/filter/version_id.rb
@@ -26,13 +26,13 @@
# See docs/COPYRIGHT.rdoc for more details.
#++
-class CostQuery::Filter::FixedVersionId < Report::Filter::Base
+class CostQuery::Filter::VersionId < Report::Filter::Base
use :null_operators
join_table WorkPackage
applies_for :label_work_package_attributes
def self.label
- WorkPackage.human_attribute_name(:fixed_version)
+ WorkPackage.human_attribute_name(:version)
end
def self.available_values(*)
diff --git a/modules/reporting/app/models/cost_query/group_by.rb b/modules/reporting/app/models/cost_query/group_by.rb
index 583be237b29..f5fa2d0258f 100644
--- a/modules/reporting/app/models/cost_query/group_by.rb
+++ b/modules/reporting/app/models/cost_query/group_by.rb
@@ -34,7 +34,7 @@ class CostQuery::GroupBy < Report::GroupBy
CostQuery::GroupBy::ActivityId,
CostQuery::GroupBy::CostObjectId,
CostQuery::GroupBy::CostTypeId,
- CostQuery::GroupBy::FixedVersionId,
+ CostQuery::GroupBy::VersionId,
CostQuery::GroupBy::WorkPackageId,
CostQuery::GroupBy::PriorityId,
CostQuery::GroupBy::ProjectId,
diff --git a/modules/reporting/app/models/cost_query/group_by/fixed_version_id.rb b/modules/reporting/app/models/cost_query/group_by/version_id.rb
similarity index 91%
rename from modules/reporting/app/models/cost_query/group_by/fixed_version_id.rb
rename to modules/reporting/app/models/cost_query/group_by/version_id.rb
index c6d6c1f40b1..33a353a6990 100644
--- a/modules/reporting/app/models/cost_query/group_by/fixed_version_id.rb
+++ b/modules/reporting/app/models/cost_query/group_by/version_id.rb
@@ -26,11 +26,11 @@
# See docs/COPYRIGHT.rdoc for more details.
#++
-class CostQuery::GroupBy::FixedVersionId < Report::GroupBy::Base
+class CostQuery::GroupBy::VersionId < Report::GroupBy::Base
join_table WorkPackage
applies_for :label_work_package_attributes
def self.label
- WorkPackage.human_attribute_name(:fixed_version)
+ WorkPackage.human_attribute_name(:version)
end
end
diff --git a/modules/reporting/spec/models/cost_query/filter_spec.rb b/modules/reporting/spec/models/cost_query/filter_spec.rb
index eb6a16bd68a..7684a0d53b5 100644
--- a/modules/reporting/spec/models/cost_query/filter_spec.rb
+++ b/modules/reporting/spec/models/cost_query/filter_spec.rb
@@ -254,9 +254,9 @@ describe CostQuery, type: :model, reporting_query_helper: true do
it "filters target version" do
matching_version = FactoryBot.create(:version, project: project)
- create_work_packages_and_time_entries(3, fixed_version: matching_version)
+ create_work_packages_and_time_entries(3, version: matching_version)
- @query.filter :fixed_version_id, operator: '=', value: matching_version.id
+ @query.filter :version_id, operator: '=', value: matching_version.id
expect(@query.result.count).to eq(3)
end
@@ -305,7 +305,7 @@ describe CostQuery, type: :model, reporting_query_helper: true do
[
CostQuery::Filter::AssignedToId,
CostQuery::Filter::CategoryId,
- CostQuery::Filter::FixedVersionId
+ CostQuery::Filter::VersionId
].each do |filter|
it "should only allow default+null operators for #{filter}" do
expect(filter.new.available_operators.uniq.sort).to eq((CostQuery::Operator.default_operators + CostQuery::Operator.null_operators).sort)
@@ -314,7 +314,7 @@ describe CostQuery, type: :model, reporting_query_helper: true do
#filter for specific objects, which can only have the default operator
[
- CostQuery::Filter::WorkPackageId,
+ CostQuery::Filter::WorkPackageId
].each do |filter|
it "should only allow default operators for #{filter}" do
expect(filter.new.available_operators.uniq).to match_array([CostQuery::Operator.default_operator])
diff --git a/modules/xls_export/lib/open_project/xls_export/work_package_xls_export.rb b/modules/xls_export/lib/open_project/xls_export/work_package_xls_export.rb
index bdefc216cf5..567e34cc7d6 100644
--- a/modules/xls_export/lib/open_project/xls_export/work_package_xls_export.rb
+++ b/modules/xls_export/lib/open_project/xls_export/work_package_xls_export.rb
@@ -17,7 +17,7 @@ module OpenProject
def work_packages
super
- .includes(:assigned_to, :type, :priority, :category, :fixed_version)
+ .includes(:assigned_to, :type, :priority, :category, :version)
end
def enable!(singleton_module)
diff --git a/spec/contracts/work_packages/base_contract_spec.rb b/spec/contracts/work_packages/base_contract_spec.rb
index ae4dafcc9d9..7c43d81016b 100644
--- a/spec/contracts/work_packages/base_contract_spec.rb
+++ b/spec/contracts/work_packages/base_contract_spec.rb
@@ -163,7 +163,7 @@ describe WorkPackages::BaseContract do
before do
version = FactoryBot.build_stubbed(:version, status: 'closed')
- work_package.fixed_version = version
+ work_package.version = version
allow(work_package.status)
.to receive(:is_closed?)
.and_return(true)
@@ -457,7 +457,7 @@ describe WorkPackages::BaseContract do
end
end
- describe 'fixed_version' do
+ describe 'version' do
subject(:contract) { described_class.new(work_package, current_user) }
let(:assignable_version) { FactoryBot.build_stubbed(:version) }
@@ -471,7 +471,7 @@ describe WorkPackages::BaseContract do
context 'for assignable version' do
before do
- work_package.fixed_version = assignable_version
+ work_package.version = assignable_version
subject.validate
end
@@ -482,12 +482,12 @@ describe WorkPackages::BaseContract do
context 'for non assignable version' do
before do
- work_package.fixed_version = invalid_version
+ work_package.version = invalid_version
subject.validate
end
it 'is invalid' do
- expect(subject.errors.symbols_for(:fixed_version_id)).to eql [:inclusion]
+ expect(subject.errors.symbols_for(:version_id)).to eql [:inclusion]
end
end
@@ -500,7 +500,7 @@ describe WorkPackages::BaseContract do
.to receive(:reopened?)
.and_return(true)
- work_package.fixed_version = assignable_version
+ work_package.version = assignable_version
subject.validate
end
@@ -511,7 +511,7 @@ describe WorkPackages::BaseContract do
context 'when not reopening the work package' do
before do
- work_package.fixed_version = assignable_version
+ work_package.version = assignable_version
subject.validate
end
@@ -778,7 +778,7 @@ describe WorkPackages::BaseContract do
assigned_to: assignee_user,
author: author_user,
status: current_status,
- fixed_version: version,
+ version: version,
type: type)
end
let!(:default_status) do
diff --git a/spec/contracts/work_packages/update_contract_spec.rb b/spec/contracts/work_packages/update_contract_spec.rb
index 50f131159d5..b90dd66ef4b 100644
--- a/spec/contracts/work_packages/update_contract_spec.rb
+++ b/spec/contracts/work_packages/update_contract_spec.rb
@@ -192,7 +192,7 @@ describe WorkPackages::UpdateContract do
end
end
- describe 'fixed_version' do
+ describe 'version' do
let(:version) { FactoryBot.build_stubbed(:version) }
before do
@@ -207,7 +207,7 @@ describe WorkPackages::UpdateContract do
context 'having full access' do
context 'with an assignable_version' do
- let(:attributes) { { fixed_version_id: version.id } }
+ let(:attributes) { { version_id: version.id } }
it 'is valid' do
expect(contract.errors).to be_empty
@@ -215,10 +215,10 @@ describe WorkPackages::UpdateContract do
end
context 'with an unassignable_version' do
- let(:attributes) { { fixed_version_id: version.id + 1 } }
+ let(:attributes) { { version_id: version.id + 1 } }
it 'adds an error' do
- expect(contract.errors.symbols_for(:fixed_version_id))
+ expect(contract.errors.symbols_for(:version_id))
.to include(:inclusion)
end
end
@@ -228,10 +228,10 @@ describe WorkPackages::UpdateContract do
let(:permissions) { %i[view_work_packages edit_work_packages] }
context 'if assigning a version' do
- let(:attributes) { { fixed_version_id: version.id } }
+ let(:attributes) { { version_id: version.id } }
it 'adds an error' do
- expect(contract.errors.symbols_for(:fixed_version_id))
+ expect(contract.errors.symbols_for(:version_id))
.to include(:error_readonly)
end
end
@@ -313,21 +313,21 @@ describe WorkPackages::UpdateContract do
context 'for a user having only the edit_work_packages permission' do
let(:permissions) { %i[edit_work_packages] }
- it 'includes all attributes except fixed_version_id' do
+ it 'includes all attributes except version_id' do
expect(subject)
.to include('subject', 'start_date', 'description')
expect(subject)
- .not_to include('fixed_version_id', 'fixed_version')
+ .not_to include('version_id', 'version')
end
end
context 'for a user having only the assign_versions permission' do
let(:permissions) { %i[assign_versions] }
- it 'includes all attributes except fixed_version_id' do
+ it 'includes all attributes except version_id' do
expect(subject)
- .to include('fixed_version_id', 'fixed_version')
+ .to include('version_id', 'version')
expect(subject)
.not_to include('subject', 'start_date', 'description')
diff --git a/spec/controllers/versions_controller_spec.rb b/spec/controllers/versions_controller_spec.rb
index ef85078d041..a2f4ca53b69 100644
--- a/spec/controllers/versions_controller_spec.rb
+++ b/spec/controllers/versions_controller_spec.rb
@@ -69,8 +69,8 @@ describe VersionsController, type: :controller do
let(:type_a) { FactoryBot.create :type }
let(:type_b) { FactoryBot.create :type }
- let(:wp_a) { FactoryBot.create :work_package, type: type_a, project: project, fixed_version: version1 }
- let(:wp_b) { FactoryBot.create :work_package, type: type_b, project: project, fixed_version: version1 }
+ let(:wp_a) { FactoryBot.create :work_package, type: type_a, project: project, version: version1 }
+ let(:wp_b) { FactoryBot.create :work_package, type: type_b, project: project, version: version1 }
before do
project.types = [type_a, type_b]
diff --git a/spec/controllers/work_packages/bulk_controller_spec.rb b/spec/controllers/work_packages/bulk_controller_spec.rb
index 1b8d2a19157..1eaaea69cd6 100644
--- a/spec/controllers/work_packages/bulk_controller_spec.rb
+++ b/spec/controllers/work_packages/bulk_controller_spec.rb
@@ -511,7 +511,7 @@ describe WorkPackages::BulkController, type: :controller do
end
describe '#version' do
- describe 'set fixed_version_id attribute to some version' do
+ describe 'set version_id attribute to some version' do
let(:version) do
FactoryBot.create(:version,
status: 'open',
@@ -528,7 +528,7 @@ describe WorkPackages::BulkController, type: :controller do
put :update,
params: {
ids: work_package_ids,
- work_package: { fixed_version_id: version.id.to_s }
+ work_package: { version_id: version.id.to_s }
}
end
@@ -537,8 +537,8 @@ describe WorkPackages::BulkController, type: :controller do
it { is_expected.to be_redirect }
describe '#work_package' do
- describe '#fixed_version' do
- subject { work_packages.map(&:fixed_version_id).uniq }
+ describe '#version' do
+ subject { work_packages.map(&:version_id).uniq }
it { is_expected.to match_array [version.id] }
end
@@ -550,19 +550,19 @@ describe WorkPackages::BulkController, type: :controller do
end
end
end
- describe 'set fixed_version_id to nil' do
+ describe 'set version_id to nil' do
before do
- # 'none' is a magic value, setting fixed_version_id to nil
+ # 'none' is a magic value, setting version_id to nil
# will make the controller ignore that param
put :update,
params: {
ids: work_package_ids,
- work_package: { fixed_version_id: 'none' }
+ work_package: { version_id: 'none' }
}
end
describe '#work_package' do
- describe '#fixed_version' do
- subject { work_packages.map(&:fixed_version_id).uniq }
+ describe '#version' do
+ subject { work_packages.map(&:version_id).uniq }
it { is_expected.to eq([nil]) }
end
diff --git a/spec/controllers/work_packages/moves_controller_spec.rb b/spec/controllers/work_packages/moves_controller_spec.rb
index 47673480bd7..1f72756542b 100644
--- a/spec/controllers/work_packages/moves_controller_spec.rb
+++ b/spec/controllers/work_packages/moves_controller_spec.rb
@@ -318,7 +318,7 @@ describe WorkPackages::MovesController, type: :controller do
end
it 'did not change the status' do
- expect(subject.fixed_version_id).to eq(work_package.fixed_version_id)
+ expect(subject.version_id).to eq(work_package.version_id)
end
it 'did not change the assignee' do
@@ -355,7 +355,7 @@ describe WorkPackages::MovesController, type: :controller do
assigned_to_id: target_user.id,
responsible_id: target_user.id,
status_id: target_status,
- fixed_version_id: target_version.id,
+ version_id: target_version.id,
start_date: start_date,
due_date: due_date
}
@@ -392,7 +392,7 @@ describe WorkPackages::MovesController, type: :controller do
end
it 'did change the version' do
- subject.map(&:fixed_version_id).each do |id|
+ subject.map(&:version_id).each do |id|
expect(id).to eq(target_version.id)
end
end
diff --git a/spec/factories/version_factory.rb b/spec/factories/version_factory.rb
index 29cd13dcd78..6a6b6cc59a5 100644
--- a/spec/factories/version_factory.rb
+++ b/spec/factories/version_factory.rb
@@ -28,10 +28,10 @@
FactoryBot.define do
factory :version do
- sequence(:name) do |i| "Version #{i}" end
+ sequence(:name) { |i| "Version #{i}" }
effective_date { Date.today + 14.days }
- created_on do Time.now end
- updated_on do Time.now end
+ created_on { Time.now }
+ updated_on { Time.now }
project
end
end
diff --git a/spec/features/projects/copy_spec.rb b/spec/features/projects/copy_spec.rb
index d179fef05f8..b589f5f0236 100644
--- a/spec/features/projects/copy_spec.rb
+++ b/spec/features/projects/copy_spec.rb
@@ -106,7 +106,7 @@ describe 'Projects copy',
responsible: wp_user,
done_ratio: 20,
category: category,
- fixed_version: version,
+ version: version,
description: 'Some desciption',
custom_field_values: { wp_custom_field.id => 'Some wp cf text' })
end
@@ -215,7 +215,7 @@ describe 'Projects copy',
.to eql work_package.description
expect(copied_work_package.category)
.to eql copied_project.categories.find_by(name: category.name)
- expect(copied_work_package.fixed_version)
+ expect(copied_work_package.version)
.to eql copied_project.versions.find_by(name: version.name)
expect(copied_work_package.custom_value_attributes)
.to eql(wp_custom_field.id => 'Some wp cf text')
diff --git a/spec/features/versions/graph_spec.rb b/spec/features/versions/graph_spec.rb
index a4c220ce8d0..36c36c82d2c 100644
--- a/spec/features/versions/graph_spec.rb
+++ b/spec/features/versions/graph_spec.rb
@@ -36,7 +36,7 @@ describe 'version show graph', type: :feature, js: true do
let!(:wp) do
FactoryBot.create :work_package,
project: project,
- fixed_version: version
+ version: version
end
before do
diff --git a/spec/features/work_packages/bulk/copy_work_package_spec.rb b/spec/features/work_packages/bulk/copy_work_package_spec.rb
index 28d70a78685..c41784ac61e 100644
--- a/spec/features/work_packages/bulk/copy_work_package_spec.rb
+++ b/spec/features/work_packages/bulk/copy_work_package_spec.rb
@@ -87,7 +87,7 @@ describe 'Copy work packages through Rails view', js: true do
end
it 'sets the version on copy' do
- select version.name, from: 'fixed_version_id'
+ select version.name, from: 'version_id'
click_on 'Copy and follow'
wp_table.expect_work_package_count 2
@@ -100,7 +100,7 @@ describe 'Copy work packages through Rails view', js: true do
# Check project of last two created wps
copied_wps = WorkPackage.last(2)
expect(copied_wps.map(&:project_id).uniq).to eq([project2.id])
- expect(copied_wps.map(&:fixed_version_id).uniq).to eq([version.id])
+ expect(copied_wps.map(&:version_id).uniq).to eq([version.id])
end
describe 'copy and follow' do
diff --git a/spec/features/work_packages/copy_spec.rb b/spec/features/work_packages/copy_spec.rb
index 5614f26d24a..f4113204940 100644
--- a/spec/features/work_packages/copy_spec.rb
+++ b/spec/features/work_packages/copy_spec.rb
@@ -57,7 +57,7 @@ RSpec.feature 'Work package copy', js: true, selenium: true do
project: project,
assigned_to: assignee,
responsible: responsible,
- fixed_version: version,
+ version: version,
type: type,
author: author)
end
@@ -116,7 +116,7 @@ RSpec.feature 'Work package copy', js: true, selenium: true do
work_package_page.ensure_page_loaded
work_package_page.expect_attributes Subject: original_work_package.subject,
Description: 'Copied WP Description',
- Version: original_work_package.fixed_version,
+ Version: original_work_package.version,
Priority: original_work_package.priority,
Assignee: original_work_package.assigned_to.name,
Responsible: original_work_package.responsible.name
@@ -170,7 +170,7 @@ RSpec.feature 'Work package copy', js: true, selenium: true do
work_package_page.ensure_page_loaded
work_package_page.expect_attributes Subject: original_work_package.subject,
Description: 'Copied WP Description',
- Version: original_work_package.fixed_version,
+ Version: original_work_package.version,
Priority: original_work_package.priority,
Assignee: original_work_package.assigned_to,
Responsible: original_work_package.responsible
diff --git a/spec/features/work_packages/details/closed_status_and_version_spec.rb b/spec/features/work_packages/details/closed_status_and_version_spec.rb
index 325f18436c3..ec235a31590 100644
--- a/spec/features/work_packages/details/closed_status_and_version_spec.rb
+++ b/spec/features/work_packages/details/closed_status_and_version_spec.rb
@@ -7,7 +7,7 @@ describe 'Closed status and version in full view', js: true do
let(:project) { FactoryBot.create(:project, types: [type]) }
let(:version) { FactoryBot.create :version, status: 'closed', project: project }
- let(:work_package) { FactoryBot.create :work_package, project: project, status: status, fixed_version: version }
+ let(:work_package) { FactoryBot.create :work_package, project: project, status: status, version: version }
let(:wp_page) { ::Pages::FullWorkPackage.new(work_package, project) }
let(:user) { FactoryBot.create :admin }
diff --git a/spec/features/work_packages/sorting/table_sorting_spec.rb b/spec/features/work_packages/sorting/table_sorting_spec.rb
index 196c903e20f..e8d6116bc39 100644
--- a/spec/features/work_packages/sorting/table_sorting_spec.rb
+++ b/spec/features/work_packages/sorting/table_sorting_spec.rb
@@ -68,8 +68,8 @@ describe 'Select work package row', type: :feature, js: true do
context 'sorting by version' do
before do
- work_package_1.update_attribute(:fixed_version_id, version_2.id)
- work_package_2.update_attribute(:fixed_version_id, version_1.id)
+ work_package_1.update_attribute(:version_id, version_2.id)
+ work_package_2.update_attribute(:version_id, version_1.id)
end
it 'sorts by version although version is not selected as a column' do
diff --git a/spec/features/work_packages/table/configuration_modal/filter_spec.rb b/spec/features/work_packages/table/configuration_modal/filter_spec.rb
index adfce581304..261d38fe7f3 100644
--- a/spec/features/work_packages/table/configuration_modal/filter_spec.rb
+++ b/spec/features/work_packages/table/configuration_modal/filter_spec.rb
@@ -24,7 +24,7 @@ describe 'Work Package table configuration modal filters spec', js: true do
context 'by version in project' do
let(:version) { FactoryBot.create :version, project: project }
- let(:work_package_with_version) { FactoryBot.create :work_package, project: project, fixed_version: version }
+ let(:work_package_with_version) { FactoryBot.create :work_package, project: project, version: version }
let(:work_package_without_version) { FactoryBot.create :work_package, project: project }
before do
diff --git a/spec/features/work_packages/table/queries/filter_spec.rb b/spec/features/work_packages/table/queries/filter_spec.rb
index f13eba93b43..1544b9d480e 100644
--- a/spec/features/work_packages/table/queries/filter_spec.rb
+++ b/spec/features/work_packages/table/queries/filter_spec.rb
@@ -73,7 +73,7 @@ describe 'filter work packages', js: true do
context 'by version in project' do
let(:version) { FactoryBot.create :version, project: project }
- let(:work_package_with_version) { FactoryBot.create :work_package, project: project, subject: 'With version', fixed_version: version }
+ let(:work_package_with_version) { FactoryBot.create :work_package, project: project, subject: 'With version', version: version }
let(:work_package_without_version) { FactoryBot.create :work_package, subject: 'Without version', project: project }
before do
diff --git a/spec/features/work_packages/table/queries/query_history_spec.rb b/spec/features/work_packages/table/queries/query_history_spec.rb
index 9f06ffc1874..ab86e5ea773 100644
--- a/spec/features/work_packages/table/queries/query_history_spec.rb
+++ b/spec/features/work_packages/table/queries/query_history_spec.rb
@@ -61,7 +61,7 @@ describe 'Going back and forth through the browser history', type: :feature, js:
FactoryBot.create(:work_package,
project: project,
type: type,
- fixed_version: version)
+ version: version)
end
let(:assignee_query) do
query = FactoryBot.create(:query,
@@ -80,7 +80,7 @@ describe 'Going back and forth through the browser history', type: :feature, js:
project: project,
user: user)
- query.add_filter('fixed_version_id', '=', [version.id])
+ query.add_filter('version_id', '=', [version.id])
query.save!
query
diff --git a/spec/features/work_packages/table/queries/query_menu_spec.rb b/spec/features/work_packages/table/queries/query_menu_spec.rb
index e48f99514d4..2f64e2ad56e 100644
--- a/spec/features/work_packages/table/queries/query_menu_spec.rb
+++ b/spec/features/work_packages/table/queries/query_menu_spec.rb
@@ -50,7 +50,7 @@ describe 'Query menu item', js: true do
context 'filtering by version in project' do
let(:version) { FactoryBot.create :version, project: project }
- let(:work_package_with_version) { FactoryBot.create :work_package, project: project, fixed_version: version }
+ let(:work_package_with_version) { FactoryBot.create :work_package, project: project, version: version }
let(:work_package_without_version) { FactoryBot.create :work_package, project: project }
before do
diff --git a/spec/fixtures/mail_handler/wp_on_given_project.eml b/spec/fixtures/mail_handler/wp_on_given_project.eml
index 1cf91d6e213..522942553ce 100644
--- a/spec/fixtures/mail_handler/wp_on_given_project.eml
+++ b/spec/fixtures/mail_handler/wp_on_given_project.eml
@@ -54,7 +54,7 @@ Status: Resolved
due date: 2010-12-31
Start Date:2010-01-01
Assigned to: John Smith
-fixed version: alpha
+Version: alpha
estimated hours: 2.5
done ratio: 30
diff --git a/spec/fixtures/mail_handler/wp_on_given_project_case_insensitive.eml b/spec/fixtures/mail_handler/wp_on_given_project_case_insensitive.eml
index b77e3dfe520..7863c4cce00 100644
--- a/spec/fixtures/mail_handler/wp_on_given_project_case_insensitive.eml
+++ b/spec/fixtures/mail_handler/wp_on_given_project_case_insensitive.eml
@@ -54,7 +54,7 @@ status: resolved
due date: 2010-12-31
Start Date:2010-01-01
Assigned to: John Smith
-fixed version: ALPHA
+version: ALPHA
priority: low
estimated hours: 2.5
done ratio: 30
diff --git a/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb b/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb
index 8c962f8cc9a..48a30259c8b 100644
--- a/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb
+++ b/spec/lib/api/v3/work_packages/eager_loading/cache_checksum_integration_spec.rb
@@ -40,7 +40,7 @@ describe ::API::V3::WorkPackages::EagerLoading::Checksum do
FactoryBot.create(:work_package,
responsible: responsible,
assigned_to: assignee,
- fixed_version: version,
+ version: version,
category: category)
end
let!(:type) { work_package.type }
@@ -118,14 +118,14 @@ describe ::API::V3::WorkPackages::EagerLoading::Checksum do
end
it 'produces a different checksum on changes to the version id' do
- WorkPackage.where(id: work_package.id).update_all(fixed_version_id: 0)
+ WorkPackage.where(id: work_package.id).update_all(version_id: 0)
expect(new_checksum)
.not_to eql orig_checksum
end
it 'produces a different checksum on changes to the version' do
- work_package.fixed_version.update_attribute(:updated_on, Time.now + 10.seconds)
+ work_package.version.update_attribute(:updated_on, Time.now + 10.seconds)
expect(new_checksum)
.not_to eql orig_checksum
diff --git a/spec/lib/api/v3/work_packages/schema/work_package_schema_representer_spec.rb b/spec/lib/api/v3/work_packages/schema/work_package_schema_representer_spec.rb
index ccd4d7bbd5b..c1f0466d829 100644
--- a/spec/lib/api/v3/work_packages/schema/work_package_schema_representer_spec.rb
+++ b/spec/lib/api/v3/work_packages/schema/work_package_schema_representer_spec.rb
@@ -700,7 +700,7 @@ describe ::API::V3::WorkPackages::Schema::WorkPackageSchemaRepresenter do
it_behaves_like 'has basic schema properties' do
let(:path) { 'version' }
let(:type) { 'Version' }
- let(:name) { I18n.t('activerecord.attributes.work_package.fixed_version') }
+ let(:name) { I18n.t('activerecord.attributes.work_package.version') }
let(:required) { false }
let(:writable) { true }
end
@@ -718,7 +718,7 @@ describe ::API::V3::WorkPackages::Schema::WorkPackageSchemaRepresenter do
it_behaves_like 'has basic schema properties' do
let(:path) { 'version' }
let(:type) { 'Version' }
- let(:name) { I18n.t('activerecord.attributes.work_package.fixed_version') }
+ let(:name) { I18n.t('activerecord.attributes.work_package.version') }
let(:required) { false }
let(:writable) { false }
end
diff --git a/spec/lib/api/v3/work_packages/work_package_payload_representer_spec.rb b/spec/lib/api/v3/work_packages/work_package_payload_representer_spec.rb
index 3e6681992d1..d129c11f4e5 100644
--- a/spec/lib/api/v3/work_packages/work_package_payload_representer_spec.rb
+++ b/spec/lib/api/v3/work_packages/work_package_payload_representer_spec.rb
@@ -343,7 +343,7 @@ describe ::API::V3::WorkPackages::WorkPackagePayloadRepresenter do
let(:version) { FactoryBot.build_stubbed(:version) }
before do
- work_package.fixed_version = version
+ work_package.version = version
end
it_behaves_like 'linked property' do
@@ -351,7 +351,7 @@ describe ::API::V3::WorkPackages::WorkPackagePayloadRepresenter do
let(:link) { "/api/v3/versions/#{version.id}" }
end
- it_behaves_like 'linked property with 0 value', :version, :fixed_version
+ it_behaves_like 'linked property with 0 value', :version, :version
end
describe 'category' do
@@ -567,12 +567,12 @@ describe ::API::V3::WorkPackages::WorkPackagePayloadRepresenter do
describe 'version' do
before do
- work_package.fixed_version_id = 1
+ work_package.version_id = 1
end
it_behaves_like 'linked resource' do
let(:attribute_name) { 'version' }
- let(:association_name) { 'fixed_version_id' }
+ let(:association_name) { 'version_id' }
end
end
diff --git a/spec/lib/api/v3/work_packages/work_package_representer_spec.rb b/spec/lib/api/v3/work_packages/work_package_representer_spec.rb
index dabf87e9660..f9fe2120262 100644
--- a/spec/lib/api/v3/work_packages/work_package_representer_spec.rb
+++ b/spec/lib/api/v3/work_packages/work_package_representer_spec.rb
@@ -446,7 +446,7 @@ describe ::API::V3::WorkPackages::WorkPackageRepresenter do
let!(:version) { FactoryBot.create :version, project: project }
before do
- work_package.fixed_version = version
+ work_package.version = version
end
it_behaves_like 'has a titled link' do
diff --git a/spec/mailers/user_mailer_spec.rb b/spec/mailers/user_mailer_spec.rb
index b7d117a9fff..336f6662fa1 100644
--- a/spec/mailers/user_mailer_spec.rb
+++ b/spec/mailers/user_mailer_spec.rb
@@ -394,12 +394,12 @@ describe UserMailer, type: :mailer do
end
end
- describe 'attribute fixed version' do
+ describe 'attribute version' do
let(:version_1) { FactoryBot.create(:version) }
let(:version_2) { FactoryBot.create(:version) }
before do
- allow(journal).to receive(:details).and_return('fixed_version_id' => [version_1.id, version_2.id])
+ allow(journal).to receive(:details).and_return('version_id' => [version_1.id, version_2.id])
end
it "shows the old version's name" do
diff --git a/spec/models/mail_handler_spec.rb b/spec/models/mail_handler_spec.rb
index a6e9d6ea8bd..3c1b63d1f5c 100644
--- a/spec/models/mail_handler_spec.rb
+++ b/spec/models/mail_handler_spec.rb
@@ -76,7 +76,7 @@ describe MailHandler, type: :model do
member_in_project: project,
member_with_permissions: permissions)
end
- let(:submit_options) { {allow_override: 'fixed_version'} }
+ let(:submit_options) { {allow_override: 'version'} }
subject do
submit_email('wp_on_given_project_case_insensitive.eml', **submit_options)
@@ -146,7 +146,7 @@ describe MailHandler, type: :model do
let!(:version) { FactoryBot.create(:version, name: 'alpha', project: project) }
include_context 'wp_on_given_project' do
- let(:submit_options) { {allow_override: 'fixed_version'} }
+ let(:submit_options) { { allow_override: 'version' } }
end
it_behaves_like 'work package created'
@@ -197,7 +197,7 @@ describe MailHandler, type: :model do
end
it 'sets the version' do
- expect(subject.fixed_version)
+ expect(subject.version)
.to eql(version)
end
@@ -374,7 +374,7 @@ describe MailHandler, type: :model do
it 'assigns the status to the created work package' do
expect(subject.status).to eq(status)
- expect(subject.fixed_version).to eq(version)
+ expect(subject.version).to eq(version)
expect(subject.priority).to eq priority_low
end
end
diff --git a/spec/models/permitted_params_spec.rb b/spec/models/permitted_params_spec.rb
index bb60ddf1607..abb18223aba 100644
--- a/spec/models/permitted_params_spec.rb
+++ b/spec/models/permitted_params_spec.rb
@@ -408,8 +408,8 @@ describe PermittedParams, type: :model do
it_behaves_like 'allows params'
end
- context 'fixed_version_id' do
- let(:hash) { { 'fixed_version_id' => '1' } }
+ context 'version_id' do
+ let(:hash) { { 'version_id' => '1' } }
it_behaves_like 'allows params'
end
diff --git a/spec/models/projects/copy_spec.rb b/spec/models/projects/copy_spec.rb
index 8e444a2283c..bacccda5698 100644
--- a/spec/models/projects/copy_spec.rb
+++ b/spec/models/projects/copy_spec.rb
@@ -269,8 +269,8 @@ describe Projects::Copy, type: :model, with_mail: false do
let(:version2) { FactoryBot.create(:version, project: project) }
before do
- work_package.update_column(:fixed_version_id, version.id)
- work_package2.update_column(:fixed_version_id, version2.id)
+ work_package.update_column(:version_id, version.id)
+ work_package2.update_column(:version_id, version2.id)
work_package3
copy.send :copy_versions, project
@@ -279,11 +279,11 @@ describe Projects::Copy, type: :model, with_mail: false do
end
it 'assigns the work packages to copies of the versions' do
- expect(copy.work_packages.detect { |wp| wp.subject == work_package.subject }.fixed_version.name)
+ expect(copy.work_packages.detect { |wp| wp.subject == work_package.subject }.version.name)
.to eql version.name
- expect(copy.work_packages.detect { |wp| wp.subject == work_package2.subject }.fixed_version.name)
+ expect(copy.work_packages.detect { |wp| wp.subject == work_package2.subject }.version.name)
.to eql version2.name
- expect(copy.work_packages.detect { |wp| wp.subject == work_package3.subject }.fixed_version)
+ expect(copy.work_packages.detect { |wp| wp.subject == work_package3.subject }.version)
.to be_nil
end
end
diff --git a/spec/models/queries/work_packages/filter/version_filter_spec.rb b/spec/models/queries/work_packages/filter/version_filter_spec.rb
index 8c651fd66fb..e9543f9fcbe 100644
--- a/spec/models/queries/work_packages/filter/version_filter_spec.rb
+++ b/spec/models/queries/work_packages/filter/version_filter_spec.rb
@@ -33,9 +33,9 @@ describe Queries::WorkPackages::Filter::VersionFilter, type: :model do
it_behaves_like 'basic query filter' do
let(:type) { :list_optional }
- let(:class_key) { :fixed_version_id }
+ let(:class_key) { :version_id }
let(:values) { [version.id.to_s] }
- let(:name) { WorkPackage.human_attribute_name('fixed_version') }
+ let(:name) { WorkPackage.human_attribute_name('version') }
before do
if project
diff --git a/spec/models/query/blubs.sql b/spec/models/query/blubs.sql
new file mode 100644
index 00000000000..19d1e410382
--- /dev/null
+++ b/spec/models/query/blubs.sql
@@ -0,0 +1,10 @@
+SELECT COUNT(DISTINCT "work_packages"."id") AS count_id, "work_packages"."responsible_id" AS work_packages_responsible_id FROM "work_packages" LEFT OUTER JOIN "statuses" ON "statuses"."id" = "work_packages"."status_id" LEFT OUTER JOIN "projects" ON "projects"."id" = "work_packages"."project_id" LEFT OUTER JOIN "users" ON "users"."id" = "work_packages"."responsible_id" LEFT OUTER JOIN "users" "assigned_tos_work_packages" ON "assigned_tos_work_packages"."id" = "work_packages"."assigned_to_id" LEFT OUTER JOIN "types" ON "types"."id" = "work_packages"."type_id" LEFT OUTER JOIN "enumerations" ON "enumerations"."id" = "work_packages"."priority_id" AND "enumerations"."type" = $1 LEFT OUTER JOIN "categories" ON "categories"."id" = "work_packages"."category_id" LEFT OUTER JOIN "versions" ON "versions"."id" = "work_packages"."version_id" WHERE "work_packages"."project_id" IN (SELECT DISTINCT "projects"."id" FROM "projects" LEFT OUTER JOIN "members" ON "projects"."id" = "members"."project_id" AND "members"."user_id" = 1 AND "projects"."status" = 1 INNER JOIN "enabled_modules" ON "projects"."id" = "enabled_modules"."project_id" AND "enabled_modules"."name" IN ('work_package_tracking') AND "projects"."status" = 1 INNER JOIN "role_permissions" ON "role_permissions"."permission" IN ('view_work_packages') INNER JOIN "roles" "permission_roles" ON "permission_roles"."id" = "role_permissions"."role_id" LEFT OUTER JOIN "member_roles" ON "members"."id" = "member_roles"."member_id" LEFT OUTER JOIN "roles" "assigned_roles" ON "assigned_roles"."id" = "permission_roles"."id" AND "projects"."status" = 1 AND ("assigned_roles"."id" = "member_roles"."role_id" OR "projects"."is_public" = TRUE AND "assigned_roles"."builtin" = 1 AND "member_roles"."id" IS NULL) WHERE "assigned_roles"."id" IS NOT NULL) AND ((projects.id IN (1,1,2)) AND (statuses.is_closed=FALSE)) GROUP BY "work_packages"."responsible_id" [["type", "IssuePriority"]]
+
+SELECT COUNT(DISTINCT "work_packages"."id") AS count_id, "work_packages"."responsible_id" AS work_packages_responsible_id FROM "work_packages" LEFT OUTER JOIN "statuses" ON "statuses"."id" = "work_packages"."status_id" LEFT OUTER JOIN "projects" ON "projects"."id" = "work_packages"."project_id" LEFT OUTER JOIN "users" ON "users"."id" = "work_packages"."responsible_id" LEFT OUTER JOIN "users" "assigned_tos_work_packages" ON "assigned_tos_work_packages"."id" = "work_packages"."assigned_to_id" LEFT OUTER JOIN "types" ON "types"."id" = "work_packages"."type_id" LEFT OUTER JOIN "enumerations" ON "enumerations"."id" = "work_packages"."priority_id" AND "enumerations"."type" IN ('IssuePriority') LEFT OUTER JOIN "categories" ON "categories"."id" = "work_packages"."category_id" LEFT OUTER JOIN "versions" ON "versions"."id" = "work_packages"."version_id" WHERE "work_packages"."project_id" IN (SELECT DISTINCT "projects"."id" FROM "projects" LEFT OUTER JOIN "members" ON "projects"."id" = "members"."project_id" AND "members"."user_id" = 1 AND "projects"."status" = 1 INNER JOIN "enabled_modules" ON "projects"."id" = "enabled_modules"."project_id" AND "enabled_modules"."name" IN ('work_package_tracking') AND "projects"."status" = 1 INNER JOIN "role_permissions" ON "role_permissions"."permission" IN ('view_work_packages') INNER JOIN "roles" "permission_roles" ON "permission_roles"."id" = "role_permissions"."role_id" LEFT OUTER JOIN "member_roles" ON "members"."id" = "member_roles"."member_id" LEFT OUTER JOIN "roles" "assigned_roles" ON "assigned_roles"."id" = "permission_roles"."id" AND "projects"."status" = 1 AND ("assigned_roles"."id" = "member_roles"."role_id" OR "projects"."is_public" = TRUE AND "assigned_roles"."builtin" = 1 AND "member_roles"."id" IS NULL) WHERE "assigned_roles"."id" IS NOT NULL) AND ((projects.id IN (1)) AND (statuses.is_closed=FALSE)) GROUP BY "work_packages"."responsible_id"
+
+
+
+
+SELECT DISTINCT "projects".* FROM "projects" LEFT OUTER JOIN "members" ON "projects"."id" = "members"."project_id" AND "members"."user_id" = 1 AND "projects"."status" = 1 LEFT OUTER JOIN "member_roles" ON "members"."id" = "member_roles"."member_id" LEFT OUTER JOIN "roles" "assigned_roles" ON 1 = 1 AND "projects"."status" = 1 AND ("assigned_roles"."id" = "member_roles"."role_id" OR "projects"."is_public" = TRUE AND "assigned_roles"."builtin" = 1 AND "member_roles"."id" IS NULL) WHERE "assigned_roles"."id" IS NOT NULL
+
+SELECT DISTINCT "projects".* FROM "projects" LEFT OUTER JOIN "members" ON "projects"."id" = "members"."project_id" AND "members"."user_id" = 1 AND "projects"."status" = 1 LEFT OUTER JOIN "member_roles" ON "members"."id" = "member_roles"."member_id" LEFT OUTER JOIN "roles" "assigned_roles" ON 1 = 1 AND "projects"."status" = 1 AND ("assigned_roles"."id" = "member_roles"."role_id" OR "projects"."is_public" = TRUE AND "assigned_roles"."builtin" = 1 AND "member_roles"."id" IS NULL) WHERE "projects"."lft" >= 1 AND "projects"."lft" < 2 AND ("projects"."id" != 1) AND "assigned_roles"."id" IS NOT NULL ORDER BY "projects"."name" ASC
diff --git a/spec/models/query/results_version_integration_spec.rb b/spec/models/query/results_version_integration_spec.rb
index 3753bc77bb0..c7f9a97d9f5 100644
--- a/spec/models/query/results_version_integration_spec.rb
+++ b/spec/models/query/results_version_integration_spec.rb
@@ -73,24 +73,24 @@ describe ::Query::Results, 'Grouping and sorting for version', type: :model, wit
let!(:newest_version_wp) do
FactoryBot.create(:work_package,
subject: 'Newest version wp',
- fixed_version: new_version,
+ version: new_version,
project: project_1)
end
let!(:oldest_version_wp) do
FactoryBot.create(:work_package,
subject: 'Oldest version wp',
- fixed_version: old_version,
+ version: old_version,
project: project_1)
end
let!(:no_date_version_wp) do
FactoryBot.create(:work_package,
subject: 'No date version wp',
- fixed_version: no_date_version,
+ version: no_date_version,
project: project_1)
end
let(:group_by) { nil }
- let(:sort_criteria) { [['fixed_version', 'asc']] }
+ let(:sort_criteria) { [['version', 'asc']] }
let(:query) do
FactoryBot.build(:query,
@@ -108,13 +108,13 @@ describe ::Query::Results, 'Grouping and sorting for version', type: :model, wit
login_as(user_1)
end
- describe 'grouping by fixed_version' do
- let(:group_by) { 'fixed_version' }
+ describe 'grouping by version' do
+ let(:group_by) { 'version' }
it 'returns the correctly sorted grouped result' do
# Keys are also sorted by the version
expect(query_results.work_package_count_by_group.keys)
- .to eql work_packages_asc.map(&:fixed_version)
+ .to eql work_packages_asc.map(&:version)
expect(query_results.work_package_count_by_group)
.to eql(old_version => 1, no_date_version => 1, new_version => 1, nil => 1)
@@ -125,7 +125,7 @@ describe ::Query::Results, 'Grouping and sorting for version', type: :model, wit
end
describe 'sorting ASC by version' do
- let(:sort_criteria) { [['fixed_version', 'asc']] }
+ let(:sort_criteria) { [['version', 'asc']] }
it 'returns the correctly sorted result' do
expect(query_results.sorted_work_packages.pluck(:id))
@@ -134,7 +134,7 @@ describe ::Query::Results, 'Grouping and sorting for version', type: :model, wit
end
describe 'sorting DESC by version' do
- let(:sort_criteria) { [['fixed_version', 'desc']] }
+ let(:sort_criteria) { [['version', 'desc']] }
it 'returns the correctly sorted result' do
# null values are still sorted last
diff --git a/spec/models/query/sort_criteria_spec.rb b/spec/models/query/sort_criteria_spec.rb
index 829211636ad..5fd6b408770 100644
--- a/spec/models/query/sort_criteria_spec.rb
+++ b/spec/models/query/sort_criteria_spec.rb
@@ -73,7 +73,7 @@ describe ::Query::SortCriteria, type: :model do
end
context 'with multiple sort_criteria with order handling and misc order statement' do
- let(:sort_criteria) { [['fixed_version', 'desc'], ['start_date', 'asc']] }
+ let(:sort_criteria) { [['version', 'desc'], ['start_date', 'asc']] }
it 'adds the order handling' do
expect(subject.length)
diff --git a/spec/models/query_spec.rb b/spec/models/query_spec.rb
index 906c607c3e9..fadbb312151 100644
--- a/spec/models/query_spec.rb
+++ b/spec/models/query_spec.rb
@@ -353,7 +353,7 @@ describe Query, type: :model do
category created_at due_date estimated_hours
parent done_ratio priority responsible
spent_hours start_date status subject type
- updated_at fixed_version) +
+ updated_at version) +
[:"cf_#{custom_field.id}"] +
[:"relations_to_type_#{type.id}"] +
%i(relations_of_type_relation1 relations_of_type_relation2)
@@ -370,7 +370,7 @@ describe Query, type: :model do
category created_at due_date estimated_hours
parent done_ratio priority responsible
spent_hours start_date status subject type
- updated_at fixed_version) +
+ updated_at version) +
[:"cf_#{custom_field.id}"]
unexpected_columns = [:"relations_to_type_#{type.id}"] +
diff --git a/spec/models/work_package_spec.rb b/spec/models/work_package_spec.rb
index 6cddb29e068..f2944816ab7 100644
--- a/spec/models/work_package_spec.rb
+++ b/spec/models/work_package_spec.rb
@@ -95,7 +95,7 @@ describe WorkPackage, type: :model do
end
describe 'minimal' do
- let(:work_package_minimal) {
+ let(:work_package_minimal) do
WorkPackage.new.tap do |w|
w.attributes = { project_id: project.id,
type_id: type.id,
@@ -104,7 +104,7 @@ describe WorkPackage, type: :model do
priority: priority,
subject: 'test_create' }
end
- }
+ end
context 'save' do
subject { work_package_minimal.save }
@@ -132,10 +132,10 @@ describe WorkPackage, type: :model do
allow(Setting).to receive(:work_package_group_assignment).and_return(true)
end
- subject {
+ subject do
FactoryBot.create(:work_package,
assigned_to: group).assigned_to
- }
+ end
it { is_expected.to eq(group) }
end
@@ -222,24 +222,24 @@ describe WorkPackage, type: :model do
expect(stub_work_package.assignable_versions).to eq([stub_version])
end
- it 'should return the former fixed_version if the version changed' do
+ it 'should return the former version if the version changed' do
stub_shared_versions
- stub_work_package.fixed_version = stub_version2
+ stub_work_package.version = stub_version2
- allow(stub_work_package).to receive(:fixed_version_id_changed?).and_return true
- allow(stub_work_package).to receive(:fixed_version_id_was).and_return(stub_version.id)
+ allow(stub_work_package).to receive(:version_id_changed?).and_return true
+ allow(stub_work_package).to receive(:version_id_was).and_return(stub_version.id)
allow(Version).to receive(:find_by).with(id: stub_version.id).and_return(stub_version)
expect(stub_work_package.assignable_versions).to eq([stub_version])
end
- it 'should return the current fixed_version if the version did not change' do
+ it 'should return the current version if the version did not change' do
stub_shared_versions
- stub_work_package.fixed_version = stub_version
+ stub_work_package.version = stub_version
- allow(stub_work_package).to receive(:fixed_version_id_changed?).and_return false
+ allow(stub_work_package).to receive(:version_id_changed?).and_return false
expect(stub_work_package.assignable_versions).to eq([stub_version])
end
@@ -248,36 +248,36 @@ describe WorkPackage, type: :model do
describe '#assignable_versions' do
let!(:work_package) do
wp = FactoryBot.create(:work_package,
- project: project,
- fixed_version: version_current)
- # remove changes to fixed version factored into
+ project: project,
+ version: version_current)
+ # remove changes to version factored into
# assignable_versions calculation
wp.reload
wp
end
let!(:version_current) do
FactoryBot.create(:version,
- status: 'closed',
- project: project)
+ status: 'closed',
+ project: project)
end
let!(:version_open) do
FactoryBot.create(:version,
- status: 'open',
- project: project)
+ status: 'open',
+ project: project)
end
let!(:version_locked) do
FactoryBot.create(:version,
- status: 'locked',
- project: project)
+ status: 'locked',
+ project: project)
end
let!(:version_closed) do
FactoryBot.create(:version,
- status: 'closed',
- project: project)
+ status: 'closed',
+ project: project)
end
let!(:version_other_project) do
FactoryBot.create(:version,
- status: 'open')
+ status: 'open')
end
it 'returns all open versions of the project' do
@@ -287,16 +287,16 @@ describe WorkPackage, type: :model do
end
describe '#destroy' do
- let(:time_entry_1) {
+ let(:time_entry_1) do
FactoryBot.create(:time_entry,
- project: project,
- work_package: work_package)
- }
- let(:time_entry_2) {
+ project: project,
+ work_package: work_package)
+ end
+ let(:time_entry_2) do
FactoryBot.create(:time_entry,
- project: project,
- work_package: work_package)
- }
+ project: project,
+ work_package: work_package)
+ end
before do
time_entry_1
@@ -319,30 +319,30 @@ describe WorkPackage, type: :model do
end
describe '#done_ratio' do
- let(:status_new) {
+ let(:status_new) do
FactoryBot.create(:status,
- name: 'New',
- is_default: true,
- is_closed: false,
- default_done_ratio: 50)
- }
- let(:status_assigned) {
+ name: 'New',
+ is_default: true,
+ is_closed: false,
+ default_done_ratio: 50)
+ end
+ let(:status_assigned) do
FactoryBot.create(:status,
- name: 'Assigned',
- is_default: true,
- is_closed: false,
- default_done_ratio: 0)
- }
- let(:work_package_1) {
+ name: 'Assigned',
+ is_default: true,
+ is_closed: false,
+ default_done_ratio: 0)
+ end
+ let(:work_package_1) do
FactoryBot.create(:work_package,
- status: status_new)
- }
- let(:work_package_2) {
+ status: status_new)
+ end
+ let(:work_package_2) do
FactoryBot.create(:work_package,
- project: work_package_1.project,
- status: status_assigned,
- done_ratio: 30)
- }
+ project: work_package_1.project,
+ status: status_assigned,
+ done_ratio: 30)
+ end
before { work_package_2 }
@@ -415,46 +415,46 @@ describe WorkPackage, type: :model do
let(:type_2) { FactoryBot.create(:type) }
let(:priority_2) { FactoryBot.create(:priority) }
let(:project) { FactoryBot.create(:project, types: [type, type_2]) }
- let(:version_1) {
+ let(:version_1) do
FactoryBot.create(:version,
- project: project)
- }
- let(:version_2) {
+ project: project)
+ end
+ let(:version_2) do
FactoryBot.create(:version,
- project: project)
- }
- let(:category_1) {
+ project: project)
+ end
+ let(:category_1) do
FactoryBot.create(:category,
- project: project)
- }
- let(:category_2) {
+ project: project)
+ end
+ let(:category_2) do
FactoryBot.create(:category,
- project: project)
- }
+ project: project)
+ end
let(:user_2) { FactoryBot.create(:user) }
- let(:work_package_1) {
+ let(:work_package_1) do
FactoryBot.create(:work_package,
- author: user,
- assigned_to: user,
- responsible: user,
- project: project,
- type: type,
- priority: priority,
- fixed_version: version_1,
- category: category_1)
- }
- let(:work_package_2) {
+ author: user,
+ assigned_to: user,
+ responsible: user,
+ project: project,
+ type: type,
+ priority: priority,
+ version: version_1,
+ category: category_1)
+ end
+ let(:work_package_2) do
FactoryBot.create(:work_package,
- author: user_2,
- assigned_to: user_2,
- responsible: user_2,
- project: project,
- type: type_2,
- priority: priority_2,
- fixed_version: version_2,
- category: category_2)
- }
+ author: user_2,
+ assigned_to: user_2,
+ responsible: user_2,
+ project: project,
+ type: type_2,
+ priority: priority_2,
+ version: version_2,
+ category: category_2)
+ end
before do
version_1
@@ -521,14 +521,14 @@ describe WorkPackage, type: :model do
end
context 'by project' do
- let(:project_2) {
+ let(:project_2) do
FactoryBot.create(:project,
- parent: project)
- }
- let(:work_package_3) {
+ parent: project)
+ end
+ let(:work_package_3) do
FactoryBot.create(:work_package,
- project: project_2)
- }
+ project: project_2)
+ end
before { work_package_3 }
@@ -560,15 +560,15 @@ describe WorkPackage, type: :model do
end
describe '#on_active_project' do
- let(:project_archived) {
+ let(:project_archived) do
FactoryBot.create(:project,
- active: false)
- }
+ active: false)
+ end
let!(:work_package) { FactoryBot.create(:work_package) }
- let(:work_package_in_archived_project) {
+ let(:work_package_in_archived_project) do
FactoryBot.create(:work_package,
- project: project_archived)
- }
+ project: project_archived)
+ end
subject { WorkPackage.on_active_project.length }
@@ -585,16 +585,16 @@ describe WorkPackage, type: :model do
describe '#with_author' do
let(:user) { FactoryBot.create(:user) }
- let(:project_archived) {
+ let(:project_archived) do
FactoryBot.create(:project,
- active: false)
- }
+ active: false)
+ end
let!(:work_package) { FactoryBot.create(:work_package, author: user) }
- let(:work_package_in_archived_project) {
+ let(:work_package_in_archived_project) do
FactoryBot.create(:work_package,
- project: project_archived,
- author: user)
- }
+ project: project_archived,
+ author: user)
+ end
subject { WorkPackage.with_author(user).length }
@@ -617,10 +617,10 @@ describe WorkPackage, type: :model do
let(:responsible) { FactoryBot.build_stubbed(:user) }
let(:work_package) do
FactoryBot.build_stubbed(:work_package,
- author: author,
- assigned_to: assignee,
- responsible: responsible,
- project: project)
+ author: author,
+ assigned_to: assignee,
+ responsible: responsible,
+ project: project)
end
let(:project_notified_users) do
@@ -771,9 +771,9 @@ describe WorkPackage, type: :model do
describe '.allowed_target_project_on_move' do
let(:project) { FactoryBot.create(:project) }
let(:role) { FactoryBot.create(:role, permissions: [:move_work_packages]) }
- let(:user) {
+ let(:user) do
FactoryBot.create(:user, member_in_project: project, member_through_role: role)
- }
+ end
context 'when having the move_work_packages permission' do
it 'returns the project' do
@@ -795,9 +795,9 @@ describe WorkPackage, type: :model do
describe '.allowed_target_project_on_create' do
let(:project) { FactoryBot.create(:project) }
let(:role) { FactoryBot.create(:role, permissions: [:add_work_packages]) }
- let(:user) {
+ let(:user) do
FactoryBot.create(:user, member_in_project: project, member_through_role: role)
- }
+ end
context 'when having the add_work_packages permission' do
it 'returns the project' do
diff --git a/spec/requests/api/v3/project_resource_spec.rb b/spec/requests/api/v3/project_resource_spec.rb
index 039278c6f52..9a3355c6912 100644
--- a/spec/requests/api/v3/project_resource_spec.rb
+++ b/spec/requests/api/v3/project_resource_spec.rb
@@ -707,7 +707,7 @@ describe 'API v3 Project resource', type: :request, content_type: :json do
context 'for a project which has a version foreign work packages refer to' do
let(:version) { FactoryBot.create(:version, project: project) }
- let(:work_package) { FactoryBot.create(:work_package, fixed_version: version) }
+ let(:work_package) { FactoryBot.create(:work_package, version: version) }
let(:setup) { work_package }
diff --git a/spec/requests/api/v3/version_resource_spec.rb b/spec/requests/api/v3/version_resource_spec.rb
index b67710834bb..78c818cbc99 100644
--- a/spec/requests/api/v3/version_resource_spec.rb
+++ b/spec/requests/api/v3/version_resource_spec.rb
@@ -468,7 +468,7 @@ describe 'API v3 Version resource', content_type: :json do
project: project).tap do |v|
FactoryBot.create(:work_package,
project: project,
- fixed_version: v)
+ version: v)
end
end
diff --git a/spec/services/work_packages/set_attributes_service_spec.rb b/spec/services/work_packages/set_attributes_service_spec.rb
index e3491ec307d..2c1cd4ab3d7 100644
--- a/spec/services/work_packages/set_attributes_service_spec.rb
+++ b/spec/services/work_packages/set_attributes_service_spec.rb
@@ -465,16 +465,16 @@ describe WorkPackages::SetAttributesService, type: :model do
end
shared_examples_for 'updating the project' do
- context 'fixed_version' do
+ context 'version' do
before do
- work_package.fixed_version = version
+ work_package.version = version
end
context 'not shared in new project' do
it 'sets to nil' do
subject
- expect(work_package.fixed_version)
+ expect(work_package.version)
.to be_nil
end
end
@@ -485,7 +485,7 @@ describe WorkPackages::SetAttributesService, type: :model do
it 'keeps the version' do
subject
- expect(work_package.fixed_version)
+ expect(work_package.version)
.to eql version
end
end
diff --git a/spec/services/work_packages/update_service_integration_spec.rb b/spec/services/work_packages/update_service_integration_spec.rb
index 4849c525b3b..1b95937e45b 100644
--- a/spec/services/work_packages/update_service_integration_spec.rb
+++ b/spec/services/work_packages/update_service_integration_spec.rb
@@ -218,7 +218,7 @@ describe WorkPackages::UpdateService, 'integration tests', type: :model, with_ma
end
let(:work_package) do
FactoryBot.create(:work_package,
- fixed_version: version,
+ version: version,
project: project)
end
@@ -227,7 +227,7 @@ describe WorkPackages::UpdateService, 'integration tests', type: :model, with_ma
expect(subject)
.to be_success
- expect(subject.result.fixed_version)
+ expect(subject.result.version)
.to be_nil
end
end
@@ -239,7 +239,7 @@ describe WorkPackages::UpdateService, 'integration tests', type: :model, with_ma
expect(subject)
.to be_success
- expect(subject.result.fixed_version)
+ expect(subject.result.version)
.to eql version
end
end
@@ -254,7 +254,7 @@ describe WorkPackages::UpdateService, 'integration tests', type: :model, with_ma
expect(subject)
.to be_success
- expect(subject.result.fixed_version)
+ expect(subject.result.version)
.to be_nil
end
end
@@ -266,7 +266,7 @@ describe WorkPackages::UpdateService, 'integration tests', type: :model, with_ma
expect(subject)
.to be_success
- expect(subject.result.fixed_version)
+ expect(subject.result.version)
.to eql version
end
end
diff --git a/spec_legacy/fixtures/mail_handler/ticket_on_given_project.eml b/spec_legacy/fixtures/mail_handler/ticket_on_given_project.eml
index 1cf91d6e213..34166bf7888 100644
--- a/spec_legacy/fixtures/mail_handler/ticket_on_given_project.eml
+++ b/spec_legacy/fixtures/mail_handler/ticket_on_given_project.eml
@@ -54,7 +54,7 @@ Status: Resolved
due date: 2010-12-31
Start Date:2010-01-01
Assigned to: John Smith
-fixed version: alpha
+version: alpha
estimated hours: 2.5
done ratio: 30
diff --git a/spec_legacy/fixtures/work_packages.yml b/spec_legacy/fixtures/work_packages.yml
index ae5f425ce67..d3c2468e89a 100644
--- a/spec_legacy/fixtures/work_packages.yml
+++ b/spec_legacy/fixtures/work_packages.yml
@@ -34,7 +34,7 @@ issues_001:
priority_id: 4
subject: Can't print recipes
id: 1
- fixed_version_id:
+ version_id:
category_id: 1
description: Unable to print recipes
type_id: 1
@@ -51,7 +51,7 @@ issues_002:
priority_id: 5
subject: Add ingredients categories
id: 2
- fixed_version_id: 2
+ version_id: 2
category_id:
description: Ingredients of the recipe should be classified by categories
type_id: 2
@@ -69,7 +69,7 @@ issues_003:
priority_id: 4
subject: Error 281 when updating a recipe
id: 3
- fixed_version_id:
+ version_id:
category_id:
description: Error 281 is encountered when saving a recipe
type_id: 1
@@ -85,7 +85,7 @@ issues_004:
priority_id: 4
subject: Issue on project 2
id: 4
- fixed_version_id:
+ version_id:
category_id:
description: Issue on project 2
type_id: 1
@@ -99,7 +99,7 @@ issues_005:
priority_id: 4
subject: Subproject issue
id: 5
- fixed_version_id:
+ version_id:
category_id:
description: This is an issue on a cookbook subproject
type_id: 1
@@ -113,7 +113,7 @@ issues_006:
priority_id: 4
subject: Issue of a private subproject
id: 6
- fixed_version_id:
+ version_id:
category_id:
description: This is an issue of a private subproject of cookbook
type_id: 1
@@ -129,7 +129,7 @@ issues_007:
priority_id: 5
subject: Issue due today
id: 7
- fixed_version_id:
+ version_id:
category_id:
description: This is an issue that is due today
type_id: 1
@@ -145,7 +145,7 @@ issues_008:
priority_id: 5
subject: Closed issue
id: 8
- fixed_version_id:
+ version_id:
category_id:
description: This is a closed issue.
type_id: 1
@@ -161,7 +161,7 @@ issues_009:
priority_id: 5
subject: Blocked Issue
id: 9
- fixed_version_id:
+ version_id:
category_id:
description: This is an issue that is blocked by issue #10
type_id: 1
@@ -177,7 +177,7 @@ issues_010:
priority_id: 5
subject: Issue Doing the Blocking
id: 10
- fixed_version_id:
+ version_id:
category_id:
description: This is an issue that blocks issue #9
type_id: 1
@@ -193,7 +193,7 @@ issues_011:
priority_id: 5
subject: Closed issue on a closed version
id: 11
- fixed_version_id: 1
+ version_id: 1
category_id: 1
description:
type_id: 1
@@ -209,7 +209,7 @@ issues_012:
priority_id: 5
subject: Closed issue on a locked version
id: 12
- fixed_version_id: 2
+ version_id: 2
category_id: 1
description:
type_id: 1
@@ -225,7 +225,7 @@ issues_013:
priority_id: 4
subject: Subproject issue two
id: 13
- fixed_version_id:
+ version_id:
category_id:
description: This is a second issue on a cookbook subproject
type_id: 1
diff --git a/spec_legacy/unit/project_spec.rb b/spec_legacy/unit/project_spec.rb
index e39e6890f1f..fb9cd75ccd9 100644
--- a/spec_legacy/unit/project_spec.rb
+++ b/spec_legacy/unit/project_spec.rb
@@ -383,7 +383,7 @@ describe Project, type: :model do
@source_project.versions << assigned_version
assert_equal 3, @source_project.versions.size
FactoryBot.create(:work_package, project: @source_project,
- fixed_version_id: assigned_version.id,
+ version_id: assigned_version.id,
subject: 'change the new issues to use the copied version',
type_id: 1,
project_id: @source_project.id)
@@ -393,9 +393,9 @@ describe Project, type: :model do
copied_issue = @project.work_packages.find_by(subject: 'change the new issues to use the copied version')
assert copied_issue
- assert copied_issue.fixed_version
- assert_equal 'Assigned Issues', copied_issue.fixed_version.name # Same name
- refute_equal assigned_version.id, copied_issue.fixed_version.id # Different record
+ assert copied_issue.version
+ assert_equal 'Assigned Issues', copied_issue.version.name # Same name
+ refute_equal assigned_version.id, copied_issue.version.id # Different record
end
it 'should change the new issues to use the copied closed version' do
@@ -404,7 +404,7 @@ describe Project, type: :model do
@source_project.versions << assigned_version
assert_equal 3, @source_project.versions.size
FactoryBot.create(:work_package, project: @source_project,
- fixed_version_id: assigned_version.id,
+ version_id: assigned_version.id,
subject: 'change the new issues to use the copied version',
type_id: 1,
project_id: @source_project.id)
@@ -415,9 +415,9 @@ describe Project, type: :model do
copied_issue = @project.work_packages.find_by(subject: 'change the new issues to use the copied version')
assert copied_issue
- assert copied_issue.fixed_version
- assert_equal 'Assigned Issues', copied_issue.fixed_version.name # Same name
- refute_equal assigned_version.id, copied_issue.fixed_version.id # Different record
+ assert copied_issue.version
+ assert_equal 'Assigned Issues', copied_issue.version.name # Same name
+ refute_equal assigned_version.id, copied_issue.version.id # Different record
end
it 'should copy issue relations' do
diff --git a/spec_legacy/unit/query_spec.rb b/spec_legacy/unit/query_spec.rb
index 9ee9d54536e..91d11bfef62 100644
--- a/spec_legacy/unit/query_spec.rb
+++ b/spec_legacy/unit/query_spec.rb
@@ -34,7 +34,7 @@ describe Query, type: :model do
it 'should system shared versions should be available in global queries' do
Version.find(2).update_attribute :sharing, 'system'
query = Query.new(project: nil, name: '_')
- assert query.filter_for('fixed_version_id')[:allowed_values].detect { |v| v.last == '2' }
+ assert query.filter_for('version_id')[:allowed_values].detect { |v| v.last == '2' }
end
it 'should project filter in global queries' do
@@ -67,9 +67,9 @@ describe Query, type: :model do
it 'should query should allow shared versions for a project query' do
subproject_version = Version.find(4)
query = Query.new(project: Project.find(1), name: '_')
- query.add_filter('fixed_version_id', '=', [subproject_version.id.to_s])
+ query.add_filter('version_id', '=', [subproject_version.id.to_s])
- assert query.statement.include?("#{WorkPackage.table_name}.fixed_version_id IN ('4')")
+ assert query.statement.include?("#{WorkPackage.table_name}.version_id IN ('4')")
end
it 'should query with multiple custom fields' do
@@ -83,9 +83,9 @@ describe Query, type: :model do
it 'should operator none' do
query = Query.new(project: Project.find(1), name: '_')
- query.add_filter('fixed_version_id', '!*', [''])
+ query.add_filter('version_id', '!*', [''])
query.add_filter('cf_1', '!*', [''])
- assert query.statement.include?("#{WorkPackage.table_name}.fixed_version_id IS NULL")
+ assert query.statement.include?("#{WorkPackage.table_name}.version_id IS NULL")
assert query.statement.include?("#{CustomValue.table_name}.value IS NULL OR #{CustomValue.table_name}.value = ''")
find_issues_with_query(query)
end
@@ -100,9 +100,9 @@ describe Query, type: :model do
it 'should operator all' do
query = Query.new(project: Project.find(1), name: '_')
- query.add_filter('fixed_version_id', '*', [''])
+ query.add_filter('version_id', '*', [''])
query.add_filter('cf_1', '*', [''])
- assert query.statement.include?("#{WorkPackage.table_name}.fixed_version_id IS NOT NULL")
+ assert query.statement.include?("#{WorkPackage.table_name}.version_id IS NOT NULL")
assert query.statement.include?("#{CustomValue.table_name}.value IS NOT NULL AND #{CustomValue.table_name}.value <> ''")
find_issues_with_query(query)
end
diff --git a/spec_legacy/unit/version_spec.rb b/spec_legacy/unit/version_spec.rb
index 725d38960db..aed6a0ab001 100644
--- a/spec_legacy/unit/version_spec.rb
+++ b/spec_legacy/unit/version_spec.rb
@@ -169,7 +169,7 @@ describe Version, type: :model do
it 'should be false if all of the issues are ahead of schedule' do
@version.update_attribute(:effective_date, 7.days.from_now.to_date)
- @version.fixed_issues = [
+ @version.work_packages = [
FactoryBot.create(:work_package, project: @project, start_date: 7.days.ago, done_ratio: 60), # 14 day span, 60% done, 50% time left
FactoryBot.create(:work_package, project: @project, start_date: 7.days.ago, done_ratio: 60) # 14 day span, 60% done, 50% time left
]
@@ -180,7 +180,7 @@ describe Version, type: :model do
it 'should be true if any of the issues are behind schedule' do
@version.update_attribute(:start_date, 7.days.ago.to_date)
@version.update_attribute(:effective_date, 7.days.from_now.to_date)
- @version.fixed_issues = [
+ @version.work_packages = [
FactoryBot.create(:work_package, project: @project, start_date: 7.days.ago, done_ratio: 60), # 14 day span, 60% done, 50% time left
FactoryBot.create(:work_package, project: @project, start_date: 7.days.ago, done_ratio: 20) # 14 day span, 20% done, 50% time left
]
@@ -190,7 +190,7 @@ describe Version, type: :model do
it 'should be false if all of the issues are complete' do
@version.update_attribute(:effective_date, 7.days.from_now.to_date)
- @version.fixed_issues = [
+ @version.work_packages = [
FactoryBot.create(:work_package, project: @project, start_date: 14.days.ago, done_ratio: 100, status: Status.find(5)), # 7 day span
FactoryBot.create(:work_package, project: @project, start_date: 14.days.ago, done_ratio: 100, status: Status.find(5)) # 7 day span
]
@@ -235,7 +235,7 @@ describe Version, type: :model do
WorkPackage.create!({ project: version.project,
priority_id: 5,
status_id: 1,
- fixed_version: version,
+ version: version,
subject: 'Test',
author: User.first,
type: version.project.types.first }.merge(attributes))