开发者

What is the equivalent of DataMapper's child_key in ActiveRecord?

What is the closest thing to child_key from DataMapper in ActiveRecord? How would one write this using ActiveRecord?

   belongs_to :something, :class_name => Foo, :child_key => [:some开发者_高级运维thing_id]


From what I read here :child_key is the foreign_key. In ActiveRecord you use :foreign_key.

   belongs_to :something, :class_name => 'Foo', :foreign_key => :something_id

If I have misunderstood the purpose of child_key, please let me know.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜