[Rails] Problem with validation

2015-04-29 Thread Gm
Hi, I'm using a custom validation method to validate some logic. But I realized that the database query is running two times. So the database is being called twice. The validation method just display an error if array items are duplicated. Log: Questao Load (0.4ms) ["a", "a"] Questao Load (0.4m

[Rails] Problem with validation

2015-04-29 Thread Gm
Hi, I'm using a custom validation method to validate some logic. But i realized that the database query is running two times. So the database is being called twice. The validation methos just display an error if array items are duplicated. Log: Prova Load (0.4ms) ["a", "a"] Questao Load (0.4ms)