摘要:
malls = Mall.allcount = 0malls.each do |mall| count += 1 if mall.parent_ids[0] province = Province.find(mall.parent_ids[0]) if !mall.address.include?(province.name) mall.address = province.name + mall.address mall.save p mall.address p count end endend 阅读全文