Skip to content

Commit ca2d8a8

Browse files
author
Conor
committed
add audit logging to class member table
Closes #417 adds audit logging to class member table, using school ID meta field
1 parent a93037a commit ca2d8a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/models/class_member.rb

+7
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ class ClassMember < ApplicationRecord
1212

1313
validate :student_has_the_school_student_role_for_the_school
1414

15+
has_paper_trail(
16+
if: ->(cm) { cm.school_class&.school_id },
17+
meta: {
18+
meta_school_id: ->(cm) { cm.school_class&.school_id }
19+
}
20+
)
21+
1522
private
1623

1724
def student_has_the_school_student_role_for_the_school

0 commit comments

Comments
 (0)