This commit is contained in:
BoHung Chiu 2022-08-04 16:35:33 +08:00
parent f8835c49d0
commit 56dad2a1b4
1 changed files with 7 additions and 2 deletions

View File

@ -272,8 +272,13 @@ class PropertyHiresController < ApplicationController
recover = false recover = false
if (session[:hire_data] rescue false) if (session[:hire_data] rescue false)
begin begin
hire = PHire.new({:id=>nil}.merge(session[:hire_data])) if session[:hire_data][:property_id] != property.id.to_s
recover = true session.delete(:hire_data)
hire = PHire.new(:id=>nil)
else
hire = PHire.new({:id=>nil}.merge(session[:hire_data]))
recover = true
end
rescue => e rescue => e
puts e.to_s puts e.to_s
hire = PHire.new(:id=>nil) hire = PHire.new(:id=>nil)