Project

General

Profile

Actions

Patch #38645

closed

RuntimeError when calling Project#destroy with overridden activity time entry

Added by Nishida Yuya 11 months ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Projects
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Enumeration has checks no records source:tags/5.0.5/app/models/enumeration.rb#L137 . So, TimeEntry is must be deleted before deleting project specific TimeEntryActivity .

only apply test/unit/project_test.rb changes on patch

yuya@yoshiyuki|0:10:39|0% bundle exec ruby ./test/unit/project_test.rb -n 'ProjectTest#test_destroy'
Run options: -n ProjectTest#test_destroy --seed 21856

# Running:

E

Error:
ProjectTest#test_destroy:
RuntimeError: Cannot delete enumeration
    app/models/enumeration.rb:137:in `check_integrity'
    app/models/enumeration.rb:90:in `destroy'
    test/unit/project_test.rb:251:in `test_destroy'

rails test test/unit/project_test.rb:228

Finished in 2.306284s, 0.4336 runs/s, 1.7344 assertions/s.
1 runs, 4 assertions, 0 failures, 1 errors, 0 skips

after apply all of patch

yuya@yoshiyuki|0:12:35|0% bundle exec ruby ./test/unit/project_test.rb -n 'ProjectTest#test_destroy'
Run options: -n ProjectTest#test_destroy --seed 4288

# Running:

.

Finished in 2.949438s, 0.3390 runs/s, 3.7295 assertions/s.
1 runs, 11 assertions, 0 failures, 0 errors, 0 skips

Files


Related issues

Is duplicate of Redmine - Defect #38286: "Cannot delete enumeration" error may occur when attempting to delete a project with time entriesClosedGo MAEDA

Actions
Actions #1

Updated by Go MAEDA 11 months ago

  • Status changed from New to Closed

Thank you for posting the patch but it has already been fixed in #38286.

Actions #2

Updated by Go MAEDA 11 months ago

  • Is duplicate of Defect #38286: "Cannot delete enumeration" error may occur when attempting to delete a project with time entries added
Actions #3

Updated by Nishida Yuya 11 months ago

Go MAEDA wrote in #note-1:

Thank you for posting the patch but it has already been fixed in #38286.

Oh, sorry! Thanks your checking.

Actions

Also available in: Atom PDF