Class: Job
Instance Attribute Summary collapse
-
#employees_override ⇒ Object
Returns the value of attribute employees_override.
-
#supervisors_override ⇒ Object
When assigning faculty to a job, the user types in a series of strings that then need to be processed :job_supervisors_override is a temporary variable that is used to do validation of the strings (to verify that they are people in the system) and then to save the people in the job_supervisors association.
Instance Method Summary
collapse
#added_people, #detect_if_list_changed, #map_member_strings_to_users, #remove_empty_fields, #removed_people, #update_collection_members, #validate_members
Instance Attribute Details
#employees_override ⇒ Object
Returns the value of attribute employees_override.
28
29
30
|
# File 'app/models/job.rb', line 28
def employees_override
@employees_override
end
|
#supervisors_override ⇒ Object
When assigning faculty to a job, the user types in a series of strings that then need to be processed :job_supervisors_override is a temporary variable that is used to do validation of the strings (to verify that they are people in the system) and then to save the people in the job_supervisors association.
27
28
29
|
# File 'app/models/job.rb', line 27
def supervisors_override
@supervisors_override
end
|
Instance Method Details
#notify_people(added_users, removed_users) ⇒ Object
#update_log(added_users, removed_users) ⇒ Object
55
56
57
58
59
60
61
62
63
|
# File 'app/models/job.rb', line 55
def update_log added_users, removed_users
self.log = "" if self.log.nil?
if added_users.present?
added_users.each { |user| self.log += Time.now.to_s + " - added " + user.human_name + "<br/>" }
end
if removed_users.present?
removed_users.each { |user| self.log += Time.now.to_s + " - removed " + user.human_name + "<br/>" }
end
end
|
#update_supervisors_and_employees ⇒ Object
43
44
45
46
|
# File 'app/models/job.rb', line 43
def update_supervisors_and_employees
update_collection_members :supervisors_override, :supervisors, :update_log
update_collection_members :employees_override, :employees, :notify_people
end
|
#validate_supervisors_and_employees ⇒ Object
38
39
40
41
|
# File 'app/models/job.rb', line 38
def validate_supervisors_and_employees
validate_members :supervisors_override
validate_members :employees_override
end
|