Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions app/models/assessments/anchorage_assessment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@ def total_anchors
(num_low_anchors || 0) + (num_high_anchors || 0)
end

sig { returns(T.any(Object, NilClass)) }
def anchorage_result
@anchor_result ||= EN14960.calculate_anchors(
length: inspection.length.to_f,
width: inspection.width.to_f,
height: inspection.height.to_f
)
end

sig { returns(Integer) }
def required_anchors
return 0 if inspection.volume.blank?
Expand All @@ -82,4 +73,15 @@ def anchorage_breakdown
return [] unless inspection.volume
anchorage_result.breakdown
end

private

sig { returns(T.any(Object, NilClass)) }
def anchorage_result
@anchor_result ||= EN14960.calculate_anchors(
length: inspection.length.to_f,
width: inspection.width.to_f,
height: inspection.height.to_f
)
end
end
5 changes: 0 additions & 5 deletions app/models/assessments/materials_assessment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,4 @@ class Assessments::MaterialsAssessment < ApplicationRecord
enum :artwork_pass, Inspection::PASS_FAIL_NA, prefix: true

after_update :log_assessment_update, if: :saved_changes?

sig { returns(T::Boolean) }
def ropes_compliant?
EN14960.valid_rope_diameter?(ropes)
end
end
10 changes: 0 additions & 10 deletions app/models/assessments/slide_assessment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,6 @@ def required_runout_length
)
end

sig { returns(String) }
def runout_compliance_status
return I18n.t("forms.slide.compliance.not_assessed") if runout.blank?
if meets_runout_requirements?
I18n.t("forms.slide.compliance.compliant")
else
I18n.t("forms.slide.compliance.non_compliant",
required: required_runout_length)
end
end

sig { returns(T::Boolean) }
def meets_wall_height_requirements?
Expand Down
Loading