打印

[问题解决]带有type字段的遗留数据库映射Model

[问题解决]带有type字段的遗留数据库映射Model

带有叫type字段Model对象一find就在基类的方法上报错了

是在现有数据库上弄的应用
字段不方便改掉
引用:
Active Record allows inheritance by storing the name of the class in a column that by default is named "type" (can be changed by overwriting Base.inheritance_column).

  inheritance_column()

Defines the column name for use with single table inheritance — can be set in subclasses like so: self.inheritance_column = "type_id"
Thank God, I'm me.

TOP