Skip to content

Instantly share code, notes, and snippets.

@rwc9u
Created December 17, 2010 17:37
Show Gist options
  • Save rwc9u/745337 to your computer and use it in GitHub Desktop.
Save rwc9u/745337 to your computer and use it in GitHub Desktop.
Getting before_validations to run
# added a new before_validation
PhoneNumber.all { |p| p.save! }
# doesn't resave the data... silly me
ActiveRecord::Base.partial_updates = false
PhoneNumber.all { |p| p.valid?; p.save! }
# now we are talking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment