logs user info in officer_assignments

In case user is no longer a poll officer, info on who did what is
stored in officer_assignment
This commit is contained in:
Juanjo Bazán
2017-02-08 15:50:13 +01:00
parent cb75be8f6a
commit d7000e399f
4 changed files with 25 additions and 1 deletions

View File

@@ -15,5 +15,11 @@ class Poll
scope :voting_days, -> { where(final: false) }
scope :final, -> { where(final: true) }
before_create :log_user_data
def log_user_data
self.user_data_log = "#{officer.user_id} - #{officer.user.name_and_email}"
end
end
end