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 CHANGED
@@ -1 +1 @@
1
- 0.3.0
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, :if => :hours_minutes
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
- self.from = DateTime.now
23
- self.to = self.from + hours.to_i.hours + minutes.to_i.minutes
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{bookyt_projects}
8
- s.version = "0.3.0"
8
+ s.version = "0.3.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Roman Simecek}]
@@ -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: 19
4
+ hash: 17
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 0
10
- version: 0.3.0
9
+ - 1
10
+ version: 0.3.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Simecek