Update_attributes for nested form

I have two models.

model A
has_many :b
def before_validation_on_create

end

model B
belongs_to :a

In b’s controller and ‘update’ action, I have

a.update_attributes(params[ :a ])

So when I was trying to create a new ‘b’, before_validation_on_create is
being called twice.

Pleas let me know if you guys have any suggestions.

Thanks in advance.