diff options
Diffstat (limited to 'app/models/time_entry_activity.rb')
-rw-r--r-- | app/models/time_entry_activity.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/time_entry_activity.rb b/app/models/time_entry_activity.rb index f2a18d1d0..58a6de13d 100644 --- a/app/models/time_entry_activity.rb +++ b/app/models/time_entry_activity.rb @@ -24,11 +24,15 @@ class TimeEntryActivity < Enumeration OptionName end + def objects + TimeEntry.where(:activity_id => self_and_descendants(1).map(&:id)) + end + def objects_count - time_entries.count + objects.count end def transfer_relations(to) - time_entries.update_all("activity_id = #{to.id}") + objects.update_all(:activity_id => to.id) end end |