class Property < ActiveRecord::Base belongs_to :owner belongs_to :country end class Owner < ActiveRecord::Base has_many :properties belongs_to :user end class User < ActiveRecord::Base end class Country < ActiveRecord::Base has_many :properties end |
Pastie
Support Pastie
or read my
Pastie << self
blog
class Property < ActiveRecord::Base belongs_to :owner belongs_to :country end class Owner < ActiveRecord::Base has_many :properties belongs_to :user end class User < ActiveRecord::Base end class Country < ActiveRecord::Base has_many :properties end |