Skip to content

Commit f41478f

Browse files
author
foradian
committed
user is_deleted feature updations in controllers
git-svn-id: file:///svn/fedena2.1/branches/fedena2.1_i18n@4110 1b8ff446-76f8-11e0-a33c-ba5893e5f458
1 parent c1f93f6 commit f41478f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

app/controllers/employee_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,6 +1720,7 @@ def delete
17201720
employee = Employee.find(params[:id])
17211721
unless employee.has_dependency
17221722
employee_subject=EmployeesSubject.destroy_all(:employee_id=>employee.id)
1723+
employee.user.destroy
17231724
employee.destroy
17241725
flash[:notice] = "#{t('flash46')}#{employee.employee_number}."
17251726
redirect_to :controller => 'user', :action => 'dashboard'

app/controllers/student_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,12 @@ def generate_all_tc_pdf
349349
def destroy
350350
student = Student.find(params[:id])
351351
unless student.check_dependency
352+
student.guardians.each do|guardian|
353+
guardian.user.destroy if guardian.user.present?
354+
guardian.destroy
355+
356+
end
357+
student.user.destroy
352358
student.destroy
353359
flash[:notice] = "#{t('flash10')}. #{student.admission_no}."
354360
redirect_to :controller => 'user', :action => 'dashboard'

0 commit comments

Comments
 (0)