I have an object called a parent that has_many child objects:
has_many :children accepts_nested_attributes_for :children, :allow_destroy => true
The child includes a module that indicates a callback :before_validation :
def self.included base base.class_eval do before_validation :my_callback end end protected def my_callback logger.debug "see me!" end
I noticed that when creating parent and nesting attributes for children, the callback :before_validation does not start for each Child. Is this the intended behavior? I tried making a before_save instead, and it works fine.
This is on Rails 3.0.10.
Thanks!
source share