OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
removing time entry constraints (#12654)
zencmp7f874e58335e
diff --git a/docs/api/apiv3/tags/time_entries.yml b/docs/api/apiv3/tags/time_entries.ymlindex 8637a2f4ab7..3fdbb7d3785 100644--- a/docs/api/apiv3/tags/time_entries.yml+++ b/docs/api/apiv3/tags/time_entries.yml@@ -27,7 +27,7 @@ description: |-| Property | Description | Type | Constraints | Supported operations | Condition || :----------: | --------------------------------------------------------- | -------- | ---------------------------------------------------- | -------------------- | ----------------------------------------------------------- || id | Time entries' id | Integer | x > 0 | READ | |- | comment | A text provided by the user detailing the time entry | String | max 255 characters | READ / WRITE | |+ | comment | A text provided by the user detailing the time entry | String | | READ / WRITE | || spentOn | The date the expenditure is booked for | Date | | READ / WRITE | || hours | The time quantifying the expenditure | Time | | READ / WRITE | || createdAt | The time the time entry was created | DateTime | | READ | |diff --git a/modules/costs/app/models/time_entry.rb b/modules/costs/app/models/time_entry.rbindex 47949bd9854..27f77878203 100644--- a/modules/costs/app/models/time_entry.rb+++ b/modules/costs/app/models/time_entry.rb@@ -42,7 +42,6 @@ class TimeEntry < ApplicationRecordvalidates_presence_of :user_id, :activity_id, :project_id, :hours, :spent_onvalidates_numericality_of :hours, allow_nil: true, message: :invalid- validates_length_of :comments, maximum: 255, allow_nil: truescope :on_work_packages, ->(work_packages) { where(work_package_id: work_packages) }diff --git a/modules/costs/spec/contracts/time_entries/shared_contract_examples.rb b/modules/costs/spec/contracts/time_entries/shared_contract_examples.rbindex 91bd5d80990..7ef1f811d62 100644--- a/modules/costs/spec/contracts/time_entries/shared_contract_examples.rb+++ b/modules/costs/spec/contracts/time_entries/shared_contract_examples.rb@@ -210,14 +210,6 @@ shared_examples_for 'time entry contract' doendend- context 'when comment is longer than 255' do- let(:time_entry_comments) { "a" * 256 }-- it 'is invalid' do- expect_valid(false, comments: %i(too_long))- end- end-context 'when comment is nil' dolet(:time_entry_comments) { nil }