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.
精彩评论