bookyt_projects 0.19.5 → 0.19.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/app/models/work_day.rb +4 -2
- data/lib/bookyt_projects/version.rb +1 -1
- metadata +3 -3
data/app/models/work_day.rb
CHANGED
@@ -3,7 +3,9 @@ class WorkDay < ActiveRecord::Base
|
|
3
3
|
belongs_to :person
|
4
4
|
validates :person, :presence => true
|
5
5
|
|
6
|
-
|
6
|
+
def activities
|
7
|
+
person.activities.where(:date => date)
|
8
|
+
end
|
7
9
|
|
8
10
|
# Order
|
9
11
|
default_scope order(:date)
|
@@ -93,7 +95,7 @@ class WorkDay < ActiveRecord::Base
|
|
93
95
|
# Calculates hours worked by summing up duration of all logged
|
94
96
|
# activities.
|
95
97
|
def calculate_hours_worked
|
96
|
-
|
98
|
+
activities.where(:date => date).sum('duration')
|
97
99
|
end
|
98
100
|
|
99
101
|
# Calculate accumulated overtime
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bookyt_projects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 95
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 19
|
9
|
-
-
|
10
|
-
version: 0.19.
|
9
|
+
- 6
|
10
|
+
version: 0.19.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Roman Simecek (CyT)
|