Skip to content

Commit

Permalink
Use delegate for application_form_id
Browse files Browse the repository at this point in the history
We can use the delegate method to define the method for us.
  • Loading branch information
thomasleese committed Oct 13, 2023
1 parent f99b9c6 commit 4fb4b33
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,5 @@ def application_form
)
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true
end
Original file line number Diff line number Diff line change
Expand Up @@ -509,9 +509,7 @@ def application_form
end
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true

def assessment_id
application_form.assessment.id
Expand Down
4 changes: 1 addition & 3 deletions spec/system/assessor_interface/completing_assessment_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,9 +414,7 @@ def then_the_application_form_is_declined
)
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true

def assessment_id
application_form.assessment.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,7 @@ def application_form
end
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true

def assessment_id
application_form.assessment.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ def application_form
end
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true

def dqt_match
{
Expand Down
4 changes: 1 addition & 3 deletions spec/system/assessor_interface/pre_assessment_tasks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,5 @@ def application_form
end
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true
end
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ def application_form_for_work_history_contact
end
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true

def assessment_id
application_form.assessment.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,7 @@ def further_information_request
)
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true

def assessment_id
application_form.assessment.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ def application_form
end
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true

def assessment_id
application_form.assessment.id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,5 @@ def application_form
end
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true
end
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,5 @@ def application_form
end
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true
end
4 changes: 1 addition & 3 deletions spec/system/assessor_interface/verifying_references_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ def application_form
end
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true

def assessment_id
application_form.assessment.id
Expand Down
4 changes: 1 addition & 3 deletions spec/system/assessor_interface/view_application_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,5 @@ def application_form
end
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true
end
4 changes: 1 addition & 3 deletions spec/system/assessor_interface/view_timeline_events_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ def application_form
end
end

def application_form_id
application_form.id
end
delegate :id, to: :application_form, prefix: true

def assessor
@assessor ||= create(:staff, :confirmed)
Expand Down

0 comments on commit 4fb4b33

Please sign in to comment.