next_sgad 0.3.5 → 0.3.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.
- checksums.yaml +4 -4
- data/app/models/next_sgad/assessment.rb +28 -0
- data/app/models/next_sgad/department.rb +44 -0
- data/app/models/next_sgad/employee.rb +22 -10
- data/app/models/next_sgad/employee_assessment.rb +28 -4
- data/app/models/next_sgad/employee_goal.rb +46 -0
- data/app/models/next_sgad/employee_message.rb +8 -2
- data/app/models/next_sgad/function.rb +14 -0
- data/app/models/next_sgad/goal.rb +27 -48
- data/app/models/next_sgad/position.rb +25 -19
- data/lib/next_sgad/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b1378122095a5945d9c9af38759594a20673bde
|
4
|
+
data.tar.gz: f8414ec87ece56c23f0c5103aa5fb9abfc36b768
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44835b93d7185177e39b7ce45e4931a228e5d81ce645e7beb2dd5e5424c1618b03869df8faf44e7309f40008d3686e5eff5428a1f7e928738ef42fce4ca6d12c
|
7
|
+
data.tar.gz: d7afac49b5c96ef47a851671c4e2da0f0ad29c27a7f9ae906da8417c1ec8f0570f30eeef74a631929db49d55b53e8fa64e6516a974b8e9861dbeb9f4d8d763c3
|
@@ -18,6 +18,15 @@ module NextSgad
|
|
18
18
|
|
19
19
|
after_create :create_employees_assessments
|
20
20
|
|
21
|
+
# get the assessment from the #{year} or the last active or from the last year
|
22
|
+
def self.get_assessment(year = nil)
|
23
|
+
if year.present?
|
24
|
+
where(year: year).last
|
25
|
+
else
|
26
|
+
active.last || where(year: Time.now.year).last
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
21
30
|
# get the last years assessment
|
22
31
|
def get_last_assessment
|
23
32
|
NextSgad::Assessment.find_by(year: year - 1)
|
@@ -139,9 +148,27 @@ module NextSgad
|
|
139
148
|
return data
|
140
149
|
end
|
141
150
|
|
151
|
+
# get the last years assessment
|
152
|
+
def get_last_assessment
|
153
|
+
NextSgad::Assessment.find_by(year: year - 1)
|
154
|
+
end
|
142
155
|
|
156
|
+
# check if last year assessments can be copied
|
157
|
+
def can_copy_last_years_skills?
|
158
|
+
last_years_skills= get_last_assessment
|
159
|
+
return false if last_years_skills.nil?
|
160
|
+
last_years_skills.goals.skill.where.not(name: goals.skill.map(&:name)).exists?
|
161
|
+
end
|
162
|
+
|
163
|
+
# get last years skills
|
164
|
+
def dup_last_year_skills
|
165
|
+
last_years_skills= get_last_assessment
|
166
|
+
return NextSgad::Goal.none if last_years_skills.nil?
|
167
|
+
last_years_skills.goals.skill.where.not(name: goals.skill.map(&:name)).map {|g| d = g.dup; d.function_ids = g.function_ids; d}
|
168
|
+
end
|
143
169
|
|
144
170
|
private
|
171
|
+
# check if the sum of all percentages is equal to 100
|
145
172
|
def percentages_values
|
146
173
|
return if skills_percentage.nil? || objectives_percentage.nil? || attendance_percentage.nil?
|
147
174
|
if skills_percentage + objectives_percentage + attendance_percentage != 100
|
@@ -151,6 +178,7 @@ module NextSgad
|
|
151
178
|
end
|
152
179
|
end
|
153
180
|
|
181
|
+
# create employee assessments for all amployees tha can be assessed
|
154
182
|
def create_employees_assessments
|
155
183
|
begin
|
156
184
|
emplos = NextSgad::Employee.can_be_assessed.map{|e| {employee_id: e.id}}
|
@@ -18,5 +18,49 @@ module NextSgad
|
|
18
18
|
errors.add(:department_id, :no_department_found_with_this_number.ts)
|
19
19
|
end
|
20
20
|
end
|
21
|
+
|
22
|
+
def name_and_number
|
23
|
+
"#{number} - #{name}"
|
24
|
+
end
|
25
|
+
|
26
|
+
# creates filter data
|
27
|
+
def self.map_for_select
|
28
|
+
all.map {|f| [f.name_and_number, f.id]}
|
29
|
+
end
|
30
|
+
|
31
|
+
# creates filter data
|
32
|
+
def self.map_for_filter
|
33
|
+
[[I18n.t(:everything), :all]] + all.map {|f| [f.name_and_number, f.id]}
|
34
|
+
end
|
35
|
+
|
36
|
+
# return a hash like {DepartmentObject => [EmployeeObject]}
|
37
|
+
# groups employee by hash
|
38
|
+
def self.employees_by_dep
|
39
|
+
pos_ind_by_emp = NextSgad::Position.all.index_by(&:efective_id)
|
40
|
+
emp_by_dep_id = all.index_by(&:id)
|
41
|
+
NextSgad::Employee.all.group_by {|e| emp_by_dep_id[pos_ind_by_emp[e.id]&.department_id]}
|
42
|
+
end
|
43
|
+
|
44
|
+
def all_employees_of_dep
|
45
|
+
positions = NextSgad::Position.where(department_id: self.id).map(&:efective_id)#all.index_by(&:efective_id)
|
46
|
+
NextSgad::Employee.all.where(id: positions) #all.group_by {|e| emp_by_dep_id[pos_ind_by_emp[e.id]&.department_id]}
|
47
|
+
end
|
48
|
+
|
49
|
+
|
50
|
+
# return a hash like {DepartmentObject => [EmployeeAssessmentObject]}
|
51
|
+
# groups employee by hash
|
52
|
+
def self.employees_assessments_by_dep(employees_assessments)
|
53
|
+
pos_ind_by_emp = NextSgad::Position.all.index_by(&:efective_id)
|
54
|
+
emp_by_dep_id = all.index_by(&:id)
|
55
|
+
employees_assessments.group_by {|e| emp_by_dep_id[pos_ind_by_emp[e.employee_id]&.department_id]}
|
56
|
+
end
|
57
|
+
|
58
|
+
|
59
|
+
# def self.dep_employee_goals
|
60
|
+
# dep_positions = NextSgad::Position.all.index_by(&:efective_id)
|
61
|
+
# dep_employees = NextSgad::Employee.all.index_by(&:id)
|
62
|
+
# dep_employee_goals = NextSgad::EmployeeGoal.all.group_by{|employee_goal| dep_positions[employee_goal&.employee_id]&.department_id}
|
63
|
+
# all.map{|dep| dep_employee_goals[dep.id]}
|
64
|
+
# end
|
21
65
|
end
|
22
66
|
end
|
@@ -30,6 +30,22 @@ module NextSgad
|
|
30
30
|
"#{number} - #{first_name} #{last_name}"
|
31
31
|
end
|
32
32
|
|
33
|
+
def self.map_for_select
|
34
|
+
all.map {|f| [f.name_and_number, f.id]}
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.map_for_filter
|
38
|
+
[[I18n.t(:everything), :all]] + all.map {|f| [f.name_and_number, f.id]}
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.map_paygrade_for_filter
|
42
|
+
[[I18n.t(:everything), :all]] + all.order(paygrade: :asc).map {|f| [f.paygrade, f.paygrade]}.uniq
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.map_level_for_filter
|
46
|
+
[[I18n.t(:everything), :all]] + all.order(level: :asc).map {|f| [f.level, f.level]}.uniq
|
47
|
+
end
|
48
|
+
|
33
49
|
def unread_messages
|
34
50
|
employee_messages.unread
|
35
51
|
end
|
@@ -55,20 +71,16 @@ module NextSgad
|
|
55
71
|
after_save :remove_assessment_data_if_employee_not_assessed
|
56
72
|
validates_presence_of :first_name, :last_name
|
57
73
|
after_create :create_employees_assessments
|
74
|
+
validates_uniqueness_of :number, if: -> (employee) {employee.number.present?}
|
58
75
|
|
59
76
|
private
|
77
|
+
# create employee assessment for the current employee
|
60
78
|
def create_employees_assessments
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
NextSgad::EmployeeAssessment.create(assessmens) do |f|
|
65
|
-
f.employee_id = id
|
66
|
-
end
|
67
|
-
rescue
|
68
|
-
p $!.bactrace
|
69
|
-
end
|
79
|
+
assessmens = NextSgad::Assessment.active.map{|e| {assessment_id: e.id, employee_id: id}}
|
80
|
+
# Creates an array like [{employee_id: 1}, {employee_id: 3}]
|
81
|
+
NextSgad::EmployeeAssessment.create(assessmens)
|
70
82
|
end
|
71
|
-
|
83
|
+
# remove all assessments if the employee can_be_assessed == false
|
72
84
|
def remove_assessment_data_if_employee_not_assessed
|
73
85
|
if is_not_assessed?
|
74
86
|
active_assessment = NextSgad::Assessment.active.last
|
@@ -20,11 +20,32 @@ module NextSgad
|
|
20
20
|
NextSgad::EmployeeGoal.where(assessment_id: assessment_id, employee_id: employee_id)
|
21
21
|
end
|
22
22
|
|
23
|
-
|
23
|
+
def status
|
24
|
+
if self_completed? && supervisor_completed? && final_completed?
|
25
|
+
:completed
|
26
|
+
elsif self_pending? && supervisor_pending? && final_pending?
|
27
|
+
:pending
|
28
|
+
else
|
29
|
+
:in_progress
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def completed?
|
34
|
+
self_completed? && supervisor_completed? && final_completed?
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.completed
|
38
|
+
all.where(self_assessment_status: 2, supervisor_assessment_status: 2, final_assessment_status: 2)
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.not_completed
|
42
|
+
all.where.not(self_assessment_status: 2, supervisor_assessment_status: 2, final_assessment_status: 2)
|
43
|
+
end
|
44
|
+
|
24
45
|
def update_statuses
|
25
46
|
goals = employee_goals()
|
26
47
|
hash = {}
|
27
|
-
|
48
|
+
|
28
49
|
if goals.where(self_assessment: 0).size == goals.size
|
29
50
|
hash[:self_assessment_status] = 0
|
30
51
|
# pending
|
@@ -35,7 +56,7 @@ module NextSgad
|
|
35
56
|
hash[:self_assessment_status] = 2
|
36
57
|
# completed
|
37
58
|
end
|
38
|
-
|
59
|
+
|
39
60
|
if goals.where(supervisor_assessment: 0).size == goals.size
|
40
61
|
hash[:supervisor_assessment_status] = 0
|
41
62
|
# pending
|
@@ -46,7 +67,7 @@ module NextSgad
|
|
46
67
|
hash[:supervisor_assessment_status] = 2
|
47
68
|
# completed
|
48
69
|
end
|
49
|
-
|
70
|
+
|
50
71
|
if goals.where(final_assessment: 0).size == goals.size
|
51
72
|
hash[:final_assessment_status] = 0
|
52
73
|
# pending
|
@@ -60,5 +81,8 @@ module NextSgad
|
|
60
81
|
|
61
82
|
update_columns(hash)
|
62
83
|
end
|
84
|
+
|
85
|
+
private
|
86
|
+
|
63
87
|
end
|
64
88
|
end
|
@@ -15,6 +15,7 @@ module NextSgad
|
|
15
15
|
|
16
16
|
validates :goal_id, uniqueness: {scope: [:employee_id]}
|
17
17
|
validates :self_assessment, :supervisor_assessment, :final_assessment, numericality: {greater_than_or_equal_to: 0, less_than_or_equal_to: 5}
|
18
|
+
after_save :update_or_create_employee_assessment
|
18
19
|
|
19
20
|
before_save :calcular_self_assessment
|
20
21
|
|
@@ -33,5 +34,50 @@ module NextSgad
|
|
33
34
|
calcular_self_assessment
|
34
35
|
save
|
35
36
|
end
|
37
|
+
|
38
|
+
def self.self_assessment_count
|
39
|
+
return 0 if self.count <= 0
|
40
|
+
self.where.not(self_assessment: 0).count
|
41
|
+
end
|
42
|
+
|
43
|
+
def self.supervisor_assessment_count
|
44
|
+
return 0 if self.count <= 0
|
45
|
+
self.where.not(supervisor_assessment: 0).count
|
46
|
+
end
|
47
|
+
|
48
|
+
def self.final_assessment_count
|
49
|
+
return 0 if self.count <= 0
|
50
|
+
self.where.not(final_assessment: 0).count
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.assessment_completion_percentage_self
|
54
|
+
employees_goals_size = self.count
|
55
|
+
return 0 if employees_goals_size <= 0
|
56
|
+
completed_employee_goals_size = self.where.not(self_assessment: 0).count
|
57
|
+
100.to_f*(completed_employee_goals_size.to_f/employees_goals_size.to_f).round(2)
|
58
|
+
end
|
59
|
+
|
60
|
+
def self.assessment_completion_percentage_supervisor
|
61
|
+
employees_goals_size = self.count
|
62
|
+
return 0 if employees_goals_size <= 0
|
63
|
+
completed_employee_goals_size = self.where.not(supervisor_assessment: 0).count
|
64
|
+
100.to_f*(completed_employee_goals_size.to_f/employees_goals_size.to_f).round(2)
|
65
|
+
end
|
66
|
+
|
67
|
+
def self.assessment_completion_percentage_final
|
68
|
+
employees_goals_size = self.count
|
69
|
+
return 0 if employees_goals_size <= 0
|
70
|
+
completed_employee_goals_size = self.where.not(final_assessment: 0).count
|
71
|
+
100.to_f*(completed_employee_goals_size.to_f/employees_goals_size.to_f).round(2)
|
72
|
+
end
|
73
|
+
|
74
|
+
def update_or_create_employee_assessment
|
75
|
+
employee_assessment = NextSgad::EmployeeAssessment.where(employee_id: employee_id, assessment_id: assessment_id).last
|
76
|
+
if employee_assessment.present?
|
77
|
+
employee_assessment.save
|
78
|
+
else
|
79
|
+
NextSgad::EmployeeAssessment.create(employee_id: employee_id, assessment_id: assessment_id)
|
80
|
+
end
|
81
|
+
end
|
36
82
|
end
|
37
83
|
end
|
@@ -2,8 +2,14 @@ module NextSgad
|
|
2
2
|
class EmployeeMessage < NextSgad::ApplicationRecord
|
3
3
|
belongs_to :message
|
4
4
|
belongs_to :employee
|
5
|
-
enum status: {unread: 0, read: 1, removed: 2}
|
6
|
-
#
|
5
|
+
enum status: {unread: 0, read: 1, removed: 2, unread_and_retracted: 3, read_and_retracted: 4}
|
6
|
+
# unread :not yet read by the employee
|
7
|
+
# read :read by the employee
|
8
|
+
# removed :read and removed by the employee
|
9
|
+
# unread_and_retracted :message retracted before the employee could read it
|
10
|
+
# read_and_retracted :message retracted afterthe employee could read it
|
11
|
+
|
12
|
+
# recall message read and unread
|
7
13
|
validates_presence_of :employee_id, :message_id
|
8
14
|
validates_uniqueness_of :employee_id, scope: [:message_id]
|
9
15
|
|
@@ -6,5 +6,19 @@ module NextSgad
|
|
6
6
|
before_save :create_number, on: :create
|
7
7
|
has_and_belongs_to_many :goals, association_foreign_key: :next_sgad_goal_id, foreign_key: :next_sgad_function_id
|
8
8
|
has_and_belongs_to_many :messages, association_foreign_key: :next_sgad_message_id, foreign_key: :next_sgad_function_id
|
9
|
+
|
10
|
+
def name_and_number
|
11
|
+
"#{number} - #{name}"
|
12
|
+
end
|
13
|
+
|
14
|
+
# creates filter data
|
15
|
+
def self.map_for_select
|
16
|
+
all.map {|f| [f.name_and_number, f.id]}
|
17
|
+
end
|
18
|
+
|
19
|
+
# creates filter data
|
20
|
+
def self.map_for_filter
|
21
|
+
[[I18n.t(:everything), :all]] + all.map {|f| [f.name_and_number, f.id]}
|
22
|
+
end
|
9
23
|
end
|
10
24
|
end
|
@@ -20,58 +20,37 @@ module NextSgad
|
|
20
20
|
|
21
21
|
|
22
22
|
def create_employee_goals
|
23
|
-
# Update existing
|
24
|
-
employee_goals.each do |employee_goal|
|
25
|
-
eg = NextSgad::EmployeeGoal.new
|
26
|
-
eg.status = status
|
27
|
-
eg.goal_type = goal_type
|
28
|
-
eg.name = name
|
29
|
-
eg.unit = unit
|
30
|
-
eg.nature = nature
|
31
|
-
eg.target = target
|
32
|
-
eg.assessment_id = assessment_id
|
33
|
-
eg.goal_id = id
|
34
|
-
eg.save
|
35
|
-
end
|
36
|
-
if skill?
|
37
|
-
# create new
|
38
|
-
positions_to = for_everyone ? NextSgad::Position.all.where.not(efective_id: nil) : NextSgad::Position.where(function_id: function_ids).where.not(efective_id: nil)
|
39
|
-
positions_to.can_be_assessed.each do |position|
|
40
|
-
next if position.efective_id.nil?
|
41
|
-
eg = NextSgad::EmployeeGoal.new
|
42
|
-
eg.status = status
|
43
|
-
eg.goal_type = goal_type
|
44
|
-
eg.name = name
|
45
|
-
eg.unit = unit
|
46
|
-
eg.nature = nature
|
47
|
-
eg.target = target
|
48
|
-
eg.assessment_id = assessment_id
|
49
|
-
eg.goal_id = id
|
50
|
-
eg.employee_id = position.efective_id
|
51
|
-
eg.position_id = position.id
|
52
|
-
eg.save
|
53
|
-
end
|
54
23
|
|
24
|
+
# checks the positions who should have this Goal
|
25
|
+
# if the employee goal is for everyone
|
26
|
+
positions_to = if for_everyone
|
27
|
+
NextSgad::Position.where.not(efective_id: nil).can_be_assessed
|
28
|
+
# if its a skill
|
29
|
+
elsif skill?
|
30
|
+
NextSgad::Position.where(function_id: function_ids).where.not(efective_id: nil).can_be_assessed
|
31
|
+
# if its an objective
|
55
32
|
elsif objective?
|
56
|
-
|
57
|
-
positions_to.can_be_assessed.each do |position|
|
58
|
-
next if position.efective_id.nil?
|
59
|
-
eg = NextSgad::EmployeeGoal.new
|
60
|
-
eg.status = status
|
61
|
-
eg.goal_type = goal_type
|
62
|
-
eg.name = name
|
63
|
-
eg.unit = unit
|
64
|
-
eg.nature = nature
|
65
|
-
eg.target = target
|
66
|
-
eg.assessment_id = assessment_id
|
67
|
-
eg.goal_id = id
|
68
|
-
eg.employee_id = position.efective_id
|
69
|
-
eg.position_id = position.id
|
70
|
-
eg.save
|
71
|
-
end
|
33
|
+
positions.where.not(efective_id: nil).can_be_assessed
|
72
34
|
end
|
73
35
|
|
74
|
-
|
36
|
+
positions_ids = positions_to.map(&:id)
|
37
|
+
# Update existing employee goals
|
38
|
+
employee_goals_to_update = employee_goals.where(position_id: positions_ids).to_a
|
39
|
+
employee_goals_to_update.each do |employee_goal|
|
40
|
+
employee_goal.update(status: status, goal_type: goal_type, name: name, unit: unit, nature: nature, target: target, assessment_id: assessment_id, goal_id: id)
|
41
|
+
end
|
75
42
|
|
43
|
+
# Destroy employee_goals deselected from the list
|
44
|
+
employee_goals.where.not(position_id: positions_ids).each(&:destroy)
|
45
|
+
|
46
|
+
# create new employee goals for the remainder
|
47
|
+
eg = NextSgad::EmployeeGoal.new(status: status, goal_type: goal_type, name: name, unit: unit, nature: nature, target: target, assessment_id: assessment_id, goal_id: id)
|
48
|
+
positions_to.where.not(id: employee_goals.map(&:position_id)).each do |position|
|
49
|
+
dupped_eg = eg.dup
|
50
|
+
dupped_eg.employee_id = position.efective_id
|
51
|
+
dupped_eg.position_id = position.id
|
52
|
+
dupped_eg.save
|
53
|
+
end
|
54
|
+
end
|
76
55
|
end
|
77
56
|
end
|
@@ -23,6 +23,16 @@ module NextSgad
|
|
23
23
|
"#{number} - #{name}"
|
24
24
|
end
|
25
25
|
|
26
|
+
# creates filter data
|
27
|
+
def self.map_for_select
|
28
|
+
all.map {|f| [f.name_and_number, f.id]}
|
29
|
+
end
|
30
|
+
|
31
|
+
# creates filter data
|
32
|
+
def self.map_for_filter
|
33
|
+
[[I18n.t(:everything), :all]] + all.map {|f| [f.name_and_number, f.id]}
|
34
|
+
end
|
35
|
+
|
26
36
|
INITIAL_LETTER = "P"
|
27
37
|
|
28
38
|
#validates_uniqueness_of :efective_id, if: -> (f) {f.efective_id.present?}, on: :create
|
@@ -31,6 +41,10 @@ module NextSgad
|
|
31
41
|
#after_create :create_goals_after_create
|
32
42
|
validates_uniqueness_of :number, if: -> (f) {f.number.present?}, on: :create
|
33
43
|
|
44
|
+
after_create :create_goals_after_create
|
45
|
+
# validates_presence_of :function_id, on: :update
|
46
|
+
# validates_uniqueness_of :number, if: -> (f) {f.number.present?}, on: :create
|
47
|
+
|
34
48
|
private
|
35
49
|
def saves_employees
|
36
50
|
return if self.employees_id == nil
|
@@ -38,32 +52,24 @@ module NextSgad
|
|
38
52
|
self.employee_ids = self.employee_ids.compact.uniq
|
39
53
|
end
|
40
54
|
|
41
|
-
|
42
|
-
assessm = NextSgad::Assessment.active.last
|
43
|
-
return if assessm.nil? || function_id.nil? || efective_id.nil? || efective.is_not_assessed?
|
44
|
-
function.goals.where(assessment_id: assessm.id).each do |goal|
|
45
|
-
eg = NextSgad::EmployeeGoal.new
|
46
|
-
eg.status = goal.status
|
47
|
-
eg.goal_type = goal.goal_type
|
48
|
-
eg.name = goal.name
|
49
|
-
eg.unit = goal.unit
|
50
|
-
eg.nature = goal.nature
|
51
|
-
eg.target = goal.target
|
52
|
-
eg.assessment_id = goal.assessment_id
|
53
|
-
eg.goal_id = goal.id
|
54
|
-
eg.employee_id = efective_id
|
55
|
-
eg.position_id = id
|
56
|
-
eg.save
|
57
|
-
end
|
58
|
-
end
|
59
|
-
|
55
|
+
# queries the positions belonging to employees tha cannot be assessed
|
60
56
|
def self.can_be_assessed
|
61
57
|
where(efective_id: [NextSgad::Employee.can_be_assessed.ids, nil])
|
62
58
|
end
|
63
59
|
|
60
|
+
# queries the positions belonging to employees tha can be assessed
|
64
61
|
def self.cannot_be_assessed
|
65
62
|
where(efective_id: NextSgad::Employee.cannot_be_assessed.ids)
|
66
63
|
end
|
67
64
|
|
65
|
+
# create employee goal after creating an position
|
66
|
+
def create_goals_after_create
|
67
|
+
assessm = NextSgad::Assessment.active.last
|
68
|
+
return if assessm.nil? || function_id.nil? || efective_id.nil?
|
69
|
+
|
70
|
+
employee_goal_data = assessm.goals.map{|g| {status: g.status, goal_type: g.goal_type, name: g.name, unit: g.unit, nature: g.nature, target: g.target, goal_id: g.id, employee_id: efective_id, position_id: id, assessment_id: assessm.id}}
|
71
|
+
NextSgad::EmployeeGoal.create(employee_goal_data)
|
72
|
+
end
|
73
|
+
|
68
74
|
end
|
69
75
|
end
|
data/lib/next_sgad/version.rb
CHANGED