This project is archived and is in readonly mode.
Callbacks not being called with validations present
-
Rory O
Sorry for the formatting, thought I had it
A normal Person class that fails on creation:
class Person < ActiveRecord::Base before_create { raise } endA failing Person class that doesn't hit raise as expected:
class Person < ActiveRecord::Base before_create { raise } validates_presence_of :name end -
Wesley Moxam
This is expected. Check the callback ordering: http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html
What you are looking for is 'before_validation_on_create'
-
Rory O
Consider this ticket me being a gigantic idiot. If I could pick myself being responsible, I would.