I have a transaction block as follow:
input1.save for i in 0 to count input2[i].input1_id = input1.id input2[i].save end end
I have used validates_uniqueness_of for input2 in the model
The problem is, when there is duplicate record in input2, input1 and the
first record in input2 are inserted into db and commited.