malls = Mall.all count = 0 malls.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 end end
|
请发表评论