c960657
(Christian Schmidt)
1
In Active Record, the callbacks for save
are before_save
/after_save
, the callbacks for destroy
are before_destroy
/after_destroy
, and so forth.
Except that the callbacks for validate
are before_validation
/after_validation
. Why not before_validate
/after_validate
?
1 Like
I have been using rails for over a decade and never noticed that. Now it’s going to bother me!
As you say, consistency would demand
before_[noun]
before_saving
before_destruction
before_validation
or
before_[verb]
before_save
before_destroy
before_validate
I’d love to know whether there is a rationale behind this, or whether it is just a historical artifact…