简体   繁体   English

inheritance_column 中的_type_disabled 是什么意思?

[英]What does :_type_disabled at inheritance_column mean?

I just came across with such a line in some model in Rails:我刚刚在 Rails 的一些 model 中遇到了这样一行:

self.inheritance_column = :_type_disabled

What does it do?它有什么作用?

And I realised what's the answer during writing the question.我在写问题的过程中意识到答案是什么。 It disables single table inheritance , what practically means that Rails won't assume that I have a special type field in my model and my eventual inheritation will have consequences only on code level, not in the database.它禁用单个表 inheritance ,这实际上意味着 Rails 不会假设我在我的 model 中有一个特殊type字段,并且我最终的继承只会在代码级别产生影响,而不会在数据库中产生影响。

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

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