after_create我有這樣的代碼在我的用戶模型 class User < ActiveRecord::Base
after_create :set_user_full_name
.........
private
def set_user_full_name
self.name = "Test name"
end
end
但是當我創
我有2種型號: class User < ActiveRecord::Base
has_one :client
end
class Client < ActiveRecord::Base
belongs_to :user
end
和我通常創建一個user第一,並有after_create過濾器,以創建client的user創建後。 after_create :cre