Step1 : add new column to Assign_tos and make sure that the data is saved on form submit
This commit is contained in:
parent
bc1c085e5e
commit
5dc5230791
5 changed files with 29 additions and 1 deletions
|
@ -3,9 +3,14 @@ class AssignTo < ApplicationRecord
|
|||
belongs_to :groupe_instructeur
|
||||
has_one :procedure_presentation, dependent: :destroy
|
||||
has_one :procedure, through: :groupe_instructeur
|
||||
before_save :save_to_new_daily_email_column
|
||||
|
||||
scope :with_email_notifications, -> { where(email_notifications_enabled: true) }
|
||||
|
||||
def save_to_new_daily_email_column
|
||||
self.daily_email_notifications_enabled = email_notifications_enabled
|
||||
end
|
||||
|
||||
def procedure_presentation_or_default_and_errors
|
||||
errors = reset_procedure_presentation_if_invalid
|
||||
[procedure_presentation || build_procedure_presentation, errors]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue