xteam_schedule 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,11 @@
|
|
1
1
|
class XTeamSchedule::Interface < XTeamSchedule::Base
|
2
2
|
belongs_to :schedule
|
3
|
-
|
3
|
+
|
4
4
|
alias_attribute :display_assignment_names, :display_assignments_name
|
5
5
|
alias_attribute :display_resource_names, :display_resources_name
|
6
6
|
alias_attribute :display_resource_pictures, :display_resources_pictures
|
7
7
|
alias_attribute :display_total_working_hours, :display_total_of_working_hours
|
8
8
|
alias_attribute :display_assignment_notes, :display_assignments_notes
|
9
|
-
|
10
|
-
TIME_GRANULARITIES = { :day => 4, :week => 2, :month => 1, :year => 0 }
|
9
|
+
|
10
|
+
TIME_GRANULARITIES = { :day => 4, :week => 2, :month => 1, :year => 0 }.freeze
|
11
11
|
end
|
@@ -1,19 +1,19 @@
|
|
1
1
|
class XTeamSchedule::WeeklyWorkingSchedule < XTeamSchedule::Base
|
2
2
|
belongs_to :schedule
|
3
3
|
has_many :working_days, :dependent => :destroy
|
4
|
-
|
4
|
+
|
5
5
|
ActiveSupport::Deprecation.silence do
|
6
6
|
after_initialize :set_default_working_days
|
7
7
|
def after_initialize
|
8
8
|
set_default_working_days
|
9
9
|
end
|
10
10
|
end
|
11
|
-
|
11
|
+
|
12
12
|
private
|
13
|
-
|
13
|
+
|
14
14
|
def set_default_working_days
|
15
15
|
return unless self.working_days.empty?
|
16
|
-
day_names = XTeamSchedule::WorkingDay::WORKING_DAY_NAMES
|
16
|
+
day_names = XTeamSchedule::WorkingDay::WORKING_DAY_NAMES.dup
|
17
17
|
weekdays = day_names[0..4]
|
18
18
|
day_names.each_with_index do |name, i|
|
19
19
|
self.working_days << XTeamSchedule::WorkingDay.new(
|
@@ -22,8 +22,8 @@ private
|
|
22
22
|
:day_end => '17:00',
|
23
23
|
:break_begin => '12:00',
|
24
24
|
:break_end => '13:00'
|
25
|
-
)
|
25
|
+
)
|
26
26
|
end
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
end
|
@@ -1,13 +1,13 @@
|
|
1
1
|
class XTeamSchedule::WorkingDay < XTeamSchedule::Base
|
2
2
|
belongs_to :weekly_working_schedule
|
3
3
|
delegate :schedule, :to => :weekly_working_schedule
|
4
|
-
|
4
|
+
|
5
5
|
validate :format_of_times
|
6
|
-
|
7
|
-
WORKING_DAY_NAMES = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
|
8
|
-
|
6
|
+
|
7
|
+
WORKING_DAY_NAMES = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'].freeze
|
8
|
+
|
9
9
|
private
|
10
|
-
|
10
|
+
|
11
11
|
def format_of_times
|
12
12
|
time_format = /\d{2}:\d{2}/
|
13
13
|
[:day_begin, :day_end, :break_begin, :break_end].each do |sym|
|
@@ -24,5 +24,5 @@ private
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
27
|
-
|
27
|
+
|
28
28
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xteam_schedule
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 1
|
10
|
+
version: 0.1.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christopher Patuzzo
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-04-14 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: plist
|