中间表没有id想直接sql操作可以这样。
sql = ActiveRecord::Base.connection()
sql.update"UPDATE team_game SET game_id =#{game2.id} WHERE game_id = #{game1.id} and team_id =#{team1.id}"
sql.insert"insert into stu_reg_infs_teams(team_id,stu_reg_inf_id) values(#{team.id},#{stu_reg_inf_id})"
sql.delete "delete from stu_reg_infs_teams where( team_id=#{stu_teams.id} and stu_reg_inf_id=#{stu_reg_inf.id})"