If your table name is compatible with the naming conventions, then you don't even need to define a model class to map it to.
如果表格的名字与命名规则是一致的,那你就不用定义模型类来映射了。
If your table name is not compatible with ActiveRecord naming conventions, then you need to explicitly map it using set_table_name inside your model class definition.
如果你的表格名与ActiveRecord命名规则不一致,你需要用set _ table_name强制把它加到模型类的定义中。
应用推荐