Browse Source

Fixed error matching housing availability

development
Godwin 8 years ago
committed by GitHub
parent
commit
43e6a14378
  1. 1
      app/helpers/application_helper.rb

1
app/helpers/application_helper.rb

@ -1158,6 +1158,7 @@ module ApplicationHelper
end end
def available_dates_match?(host, guest) def available_dates_match?(host, guest)
return false unless host.housing_data['availability'].present? && host.housing_data['availability'][1].present?
if host.housing_data['availability'][0] <= guest.arrival && if host.housing_data['availability'][0] <= guest.arrival &&
host.housing_data['availability'][1] >= guest.departure host.housing_data['availability'][1] >= guest.departure
return true return true

Loading…
Cancel
Save