I have two models:
我有两个型号:
class Category < ActiveRecord::Base
has_one :weight
after_create :create_category_weight
def create_category_weight
self.weight = Weight.new :value => 1/Category.count
end
end
class Category <I have two models:
我有两个型号:
class Category < ActiveRecord::Base
has_one :weight
after_create :create_category_weight
def create_category_weight
self.weight = Weight.new :value => 1/Category.count
end
end
class Category <