LOL. Platform should belongs_to parent platform instead of has_one

This commit is contained in:
Timothy N. Tsvetkov 2011-03-31 03:27:14 +04:00
parent 5bed0adbf9
commit ab07c2362e
1 changed files with 1 additions and 1 deletions

View File

@ -1,5 +1,5 @@
class Platform < ActiveRecord::Base
has_one :parent, :class_name => 'Platform', :foreign_key => 'parent_platform_id'
belongs_to :parent, :class_name => 'Platform', :foreign_key => 'parent_platform_id'
has_many :repositories, :dependent => :destroy
validate :name, :presence => true, :uniqueness => true