我尝试过改变祖先模型的所有兄弟姐妹(从活动模型代码)母公司: def change_parents_of_siblings
to_change = self.siblings.where.not(id: self.id)
to_change.each do |sib|
sib.update!(parent: self)
end
end
如果我打印功能里
试图为嵌套区域记录创建工厂。为此,我使用ancestry宝石。地区是地方关联实体 地点工厂: factory :place, traits: [:pageable] do
...
association :region, factory: :nested_regions
end
地区工厂: factory :region do
level 'area'