Project

General

Profile

Actions

Defect #15983

closed

Project.activities returns different types depending on context

Added by Massimo Rossello about 10 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Code cleanup/refactoring
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Project.active_activities, Project.all_activities and, ultimately, Project.activities return:
  • a database relation if the activities on the project are untouched (through TimeEntryActivity.shared.active)
  • an Array if some activities are overridden (through Project.system_activities_and_project_overrides).

This makes any calling code unable to make further operations on the results, and leads to errors that are hard to understand.

Actions

Also available in: Atom PDF