File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -355,7 +355,17 @@ def update_addresses_dao_info(addrs_deposit_info)
355355 is_depositor : address_info [ :is_depositor ] ,
356356 }
357357 end
358- Address . upsert_all ( addresses_deposit_attributes , record_timestamps : true ) if addresses_deposit_attributes . present?
358+ if addresses_deposit_attributes . present?
359+ Address . upsert_all (
360+ addresses_deposit_attributes ,
361+ record_timestamps : true ,
362+ on_duplicate : Arel . sql (
363+ "dao_deposit = COALESCE(EXCLUDED.dao_deposit, addresses.dao_deposit), " \
364+ "interest = COALESCE(EXCLUDED.interest, addresses.interest), " \
365+ "is_depositor = COALESCE(EXCLUDED.is_depositor, addresses.is_depositor)" ,
366+ ) ,
367+ )
368+ end
359369 end
360370
361371 def update_or_create_udt_accounts! ( local_block )
You can’t perform that action at this time.
0 commit comments