bookyt_projects 0.14.0 → 0.18.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,10 +15,13 @@ class WorkDay < ActiveRecord::Base
15
15
 
16
16
  def self.create_for_current_employment(employee)
17
17
  if employee.employments.current
18
- range = employee.employments.current.duration_from..Date.today
19
- range.each do |date|
18
+ workdays = WorkDay.where(:person_id => employee.id)
19
+ start_date = workdays.last.date unless workdays.empty?
20
+ start_date ||= employee.employments.current.duration_from
21
+
22
+ (start_date..Date.today).each do |date|
20
23
  WorkDay.create(:person => employee, :date => date)
21
- end
24
+ end if workdays.last && (workdays.last.date < start_date)
22
25
  end
23
26
  end
24
27
 
@@ -1,3 +1,3 @@
1
1
  module BookytPos
2
- VERSION = '0.14.0'
2
+ VERSION = '0.18.1'
3
3
  end
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: 39
4
+ hash: 85
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 14
9
- - 0
10
- version: 0.14.0
8
+ - 18
9
+ - 1
10
+ version: 0.18.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Simecek (CyT)
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2012-01-18 00:00:00 Z
19
+ date: 2012-01-19 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
22
  name: rails
@@ -179,10 +179,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
179
  requirements: []
180
180
 
181
181
  rubyforge_project:
182
- rubygems_version: 1.8.10
182
+ rubygems_version: 1.8.12
183
183
  signing_key:
184
184
  specification_version: 3
185
185
  summary: Project management plugin for bookyt
186
186
  test_files: []
187
187
 
188
- has_rdoc: