Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
CatalinVoineag committed Aug 20, 2024
1 parent f8a10bd commit b0d0c8b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 11 additions & 1 deletion app/models/application_work_history_break.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
class ApplicationWorkHistoryBreak < ApplicationRecord
include TouchApplicationChoices
self.ignore_columns = %w[application_form_id]

belongs_to :application_form, touch: true, optional: true
belongs_to :breakable, polymorphic: true

before_save -> { self.application_form_id = breakable_id }, if: -> { application_form_id.nil? }

after_commit do
if application_form
breakable.touch_choices
end
end

audited associated_with: :application_form

def application_form=(value)
Expand All @@ -16,4 +22,8 @@ def application_form=(value)
def length
((end_date.year * 12) + end_date.month) - ((start_date.year * 12) + start_date.month) - 1
end

def application_form
breakable if breakable_type == 'ApplicationForm'
end
end
1 change: 0 additions & 1 deletion config/analytics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ shared:
- degree_institution_uuid
- degree_grade_uuid
application_work_history_breaks:
- application_form_id
- breakable_type
- breakable_id
- created_at
Expand Down

0 comments on commit b0d0c8b

Please sign in to comment.