From b304c3a1759ad081aa082ea4abce920d0b9ebeea Mon Sep 17 00:00:00 2001 From: Ricky Barrette Date: Fri, 29 Dec 2023 19:09:24 -0500 Subject: [PATCH] Fixed employee typo --- app/models/employee.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/app/models/employee.rb b/app/models/employee.rb index efc4a1f..3319558 100644 --- a/app/models/employee.rb +++ b/app/models/employee.rb @@ -1,6 +1,6 @@ #The MIT License (MIT) # -#Copyright (c) 2022 rick barrette +#Copyright (c) 2023 rick barrette # #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: # @@ -22,10 +22,11 @@ class Employee < ActiveRecord::Base transaction do # Update the item table - employees.each { |employee| - employee = find_or_create_by(id: employee.id) - employee.name = employee.display_name - employee.id = employee.id + employees.each { |e| + logger.info "Processing employee #{e.id}" + employee = find_or_create_by(id: e.id) + employee.name = e.display_name + employee.id = e.id employee.save! } end