This project is archived and is in readonly mode.

#3607 ✓wontfix
gucki

after_validate does not stop when false is returned

Reported by gucki | December 23rd, 2009 @ 06:56 AM

class Address < ActiveRecord::Base
acts_as_mappable

belongs_to :user belongs_to :country

validates_presence_of :address validates_length_of :address, :within => 3..100

validates_presence_of :country validates_associated :country

after_validation :geocode_address

private

def geocode_address

errors.add(:address, "Could not Geocode address")
return false

end end

Using "before_validation" instead of "after_validation" works.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages