Custom form Validation Rails <p>I am wondering if i have set up my method incorrectly as my validation attempt is being ignored halfway through the method. (i have provided a basic example, i want to get this working before adding more)</p> <p>I have two variations of a form all belonging to the same object. The forms are differentiated by a column animal_type as you can see in my method</p> <pre><code> class Animal &lt; ActiveRecord::Base before_save :animal_form_validation private def animal_form_validation if self.animal_type == 'Dog' ap('Im validating the dog Form') if self.name.length &lt;= 0 errors.add(:name, "Name cannot be blank") end elsif self.animal_type == 'Cat' ap('Im validating the cat form') if self.name.length &lt;= 0 errors.add(:name, "Name cannot be blank") end end end end </code></pre> <p>whether i am submitting a cat or dog i get the correct message in the console (using awesome print), so the method is running and knows which form im submitting, but as for the next if statement it is being ignored.</p> <p>So i have an error with my syntax? or am i calling the wrong validation check on the name field ?</p> <p>Thanks</p>