Skip to content

Commit

Permalink
fix: error regression
Browse files Browse the repository at this point in the history
  • Loading branch information
diegosteiner committed Sep 30, 2024
1 parent 5ad7bc8 commit a8305da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/models/booking_conditions/occupancy_duration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ def evaluate!(booking)
compare_value_match = compare_value_regex.match(compare_value)
return false unless compare_value_match

actual_value = booking.duration
return nil if actual_value.blank?

compare_value = threshold_unit(compare_value_match[:threshold], compare_value_match[:threshold_unit])
evaluate_operator(compare_operator.presence || :'=', with: { actual_value: booking.duration, compare_value: })
evaluate_operator(compare_operator.presence || :'=', with: { actual_value:, compare_value: })
end

protected
Expand Down

0 comments on commit a8305da

Please sign in to comment.