0
我Rails的Model.reset_column_information
Product
模型
belongs_to :detail, counter_cache: true
我的移民
add_column :details, :products_count, :integer, default: 0
,并希望与(products_count)
Detail.reset_column_information
重置10
之后却我的对象仍然有products_count=>20
所以我的问题是
1.how当我删除相关产品的OBJ正确products_count
复位?
2.为什么它reset_column_information
没有做到这一点?
或者我错过了什么?