简体   繁体   English

在has_and_belongs_to_many上进行版本控制?

[英]versioning on a has_and_belongs_to_many?

Is it possible at all to have versioning for has_and_belongs_to_many associations? 是否可以对has_and_belongs_to_many关联进行版本控制? The official documentation only briefly mentions has_many and belongs_to . 官方文档仅简要提及has_manybelongs_to I have added papertrail on both ends of my has_and_belongs_to_many association, run the migrations and whenever I update the association from either end, nothing ever gets added to the version_associations table. 我在has_and_belongs_to_many关联的两端添加了papertrail,运行迁移,每当我从任一端更新关联时,都没有任何东西被添加到version_associations表中。 Could someone point me in the right direction? 有人能指出我正确的方向吗?

Is it possible at all to have versioning for has_and_belongs_to_many associations? 是否可以对has_and_belongs_to_many关联进行版本控制?

Yes. 是。 HABTM reification was added very recently (2016-04-25) in PR 771 and released in version 5.0.0 . 最近(2016-04-25)在PR 771中添加了HABTM reification,并在5.0.0版本中发布

The official documentation [does not mention HABTM] .. 官方文件[未提及HABTM] ..

That's correct. 那是对的。 We'd appreciate contributions to that documentation, thanks! 我们非常感谢对该文档的贡献,谢谢!

PS: Please note that associations are an experimental feature, not recommended for production systems. PS:请注意,关联是一项实验性功能,不建议用于生产系统。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM