We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
activerecord-jdbc-adapter 具有对 DB2 的内置支持。您是否存在特定的架构问题?我已经能够让 ActiveRecord 与多个遗留模式一起使用。
更新:
对于不匹配的表名,只需放入
模型即可。您可以指定关系中使用的类和/或外键:(
有关更多选项,请参阅 http://apidock.com/rails/ActiveRecord/Associations/ClassMethods)。
对于复合主键,请参阅复合主键 gem。
activerecord-jdbc-adapter has built-in support for DB2. Is there a particular schema problem you have? I've been able to get ActiveRecord to work with several legacy schemas.
Update:
For table names that don't match, simply put
in the model. You can specify the class used in a relationhip, and/or the foreign key:
(For more of the options see http://apidock.com/rails/ActiveRecord/Associations/ClassMethods).
For composite primary keys, see the Composite Primary Keys gem.