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
[32811] Remove 24h time entries time limit for now
Oliver Günther32c9b9e3ff69
diff --git a/app/contracts/time_entries/base_contract.rb b/app/contracts/time_entries/base_contract.rbindex d72e774280a..140678c473e 100644--- a/app/contracts/time_entries/base_contract.rb+++ b/app/contracts/time_entries/base_contract.rb@@ -56,9 +56,7 @@ module TimeEntriesattribute :activity_id dovalidate_activity_activeend- attribute :hours do- validate_day_limit- end+ attribute :hoursattribute :commentsattribute_alias :comments, :comment@@ -98,14 +96,6 @@ module TimeEntrieserrors.add :activity_id, :inclusion if model.activity_id && !assignable_activities.exists?(model.activity_id)end- def validate_day_limit- return unless model.spent_on && model.hours-- if hours_extending_day_limit?- errors.add :hours, :day_limit- end- end-def work_package_invisible?model.work_package.nil? || !model.work_package.visible?(user)end@@ -113,11 +103,5 @@ module TimeEntriesdef work_package_not_in_project?model.work_package && model.project != model.work_package.projectend-- def hours_extending_day_limit?- existing_sum = TimeEntry::Scopes::OfUserAndDay.fetch(model.user, model.spent_on, excluding: model).sum(:hours)-- existing_sum + model.hours > 24- endendenddiff --git a/spec/contracts/time_entries/shared_contract_examples.rb b/spec/contracts/time_entries/shared_contract_examples.rbindex 3f4307acb0d..9adb4868eb8 100644--- a/spec/contracts/time_entries/shared_contract_examples.rb+++ b/spec/contracts/time_entries/shared_contract_examples.rb@@ -205,8 +205,8 @@ shared_examples_for 'time entry contract' docontext 'if more than 24 hours are booked for a day' dolet(:time_entry_day_sum) { 24 - time_entry_hours + 1 }- it 'is invalid' do- expect_valid(false, hours: %i(day_limit))+ it 'is valid' do+ expect_valid(true)endend