fix error

This commit is contained in:
chiu 2020-08-05 14:50:54 +08:00
parent 7c847ed56b
commit c9157e9132
1 changed files with 2 additions and 2 deletions

View File

@ -55,7 +55,7 @@ class VenueManagementContract
belongs_to :venue_management_inviting belongs_to :venue_management_inviting
include VenueLinkFile include VenueLinkFile
before_save do before_save do
org_contract = VenueManagementContract.find(self.id) org_contract = VenueManagementContract.find(self.id) rescue nil
inviting = VenueManagementInviting.find(self.venue_management_inviting_id) rescue nil inviting = VenueManagementInviting.find(self.venue_management_inviting_id) rescue nil
if !inviting.nil? if !inviting.nil?
%i(case_no publish_times start_date end_date close_date bid_date evaluation_date contractor_manager bid_result details).each do |attr_| %i(case_no publish_times start_date end_date close_date bid_date evaluation_date contractor_manager bid_result details).each do |attr_|
@ -65,7 +65,7 @@ class VenueManagementContract
self[:case_no] = nil self[:case_no] = nil
end end
update_flag = true update_flag = true
if org_contract.venue_management_inviting_id == self.venue_management_inviting_id if !org_contract.nil? && org_contract.venue_management_inviting_id == self.venue_management_inviting_id
%i(early_rent operation_rent royalty house_tax_payer land_tax_payer).each do |attr_| %i(early_rent operation_rent royalty house_tax_payer land_tax_payer).each do |attr_|
if self[attr_] != (inviting.send(attr_) rescue nil) if self[attr_] != (inviting.send(attr_) rescue nil)
update_flag = false update_flag = false