bookyt_projects 0.3.0 → 0.3.1
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/VERSION +1 -1
- data/app/models/task.rb +5 -3
- data/bookyt_projects.gemspec +1 -1
- data/lib/bookyt_projects/navigation.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.1
|
data/app/models/task.rb
CHANGED
@@ -12,15 +12,17 @@ class Task < ActiveRecord::Base
|
|
12
12
|
validates_numericality_of :hours, :only_integer => true, :unless => :from
|
13
13
|
validates_numericality_of :minutes, :only_integer => true, :unless => :from
|
14
14
|
|
15
|
-
before_save :calculate_hours
|
15
|
+
before_save :calculate_hours
|
16
16
|
|
17
17
|
def hours_minutes
|
18
18
|
minutes || hours
|
19
19
|
end
|
20
20
|
|
21
21
|
def calculate_hours
|
22
|
-
|
23
|
-
|
22
|
+
unless hours.empty? or minutes.empty?
|
23
|
+
self.from = DateTime.now
|
24
|
+
self.to = self.from + hours.to_i.hours + minutes.to_i.minutes
|
25
|
+
end
|
24
26
|
end
|
25
27
|
|
26
28
|
# The duration of the task in minutes
|
data/bookyt_projects.gemspec
CHANGED
@@ -2,7 +2,7 @@ module BookytProjects
|
|
2
2
|
module Navigation
|
3
3
|
def setup_bookyt_projects(navigation)
|
4
4
|
navigation.item :projects, t_model(Project), projects_path, :if => Proc.new { user_signed_in? } do |projects|
|
5
|
-
projects.item :project_index, t_title(:index, Project), projects_path, :highlights_on => /\/projects($|\/[0-9]*($|\/.*))/
|
5
|
+
projects.item :project_index, t_title(:index, Project), projects_path, :highlights_on => /\/(projects|tasks)($|\/[0-9]*($|\/.*))/
|
6
6
|
projects.item :capture_hours, t_title(:new, Task), new_task_path
|
7
7
|
projects.item :new_project, t_title(:new, Project), new_project_path
|
8
8
|
projects.item :project_states, t_model(ProjectState), project_states_path, :highlights_on => /\/project_states($|\/([0-9]*|new)($|\/.*))/
|
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: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 1
|
10
|
+
version: 0.3.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Roman Simecek
|