Ruby on Rails
■ このスレッドは過去ログ倉庫に格納されています
0382デフォルトの名無しさん
2008/01/08(火) 22:20:06こんなのパターンかい?
A: customer(id, name)
B: subscription(id, customer_id, magazine_id, paid, expire_at)
C: magazine(id, title)
class Customer < AR::Base
has_many :subscriptions
end
class Magazine < AR::Base
has_many :subscriptions
end
class Subscription < AR::Base
belongs_to :customer
belongs_to :magazine
end
■ このスレッドは過去ログ倉庫に格納されています