origo

origo

BlogJava 首页 新随笔 联系 聚合 管理
  15 Posts :: 0 Stories :: 13 Comments :: 0 Trackbacks
两个类:比如 User 和 Order 是一对多关系
===============================
class User < ActiveRecord::Base
  has_many :orders
end

class Order < ActiveRecord::Base
   belongs_to :user, :foreign_key => "user_id"
end

posted on 2008-03-16 16:41 origo 阅读(229) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: