class Community
has_many: people
attr_accessor :name, :url
end
class Person
belongs_to :community
attr_accessor :name, :gender, :age, :hometown, :city_live_in, :job
validates_presence_of :name, :gender, :age, :city_live_in
validates_format_of :gender, :with => /[M|F]/i, :message => 'You from Thailand?'
validates_uniqueness_of :name
end
rcc = Community.new
rcc.name = 'Ruby中文社区'
rcc.url = 'http://www.ruby-lang.org.cn'
rcc.save
#rcc means "Ruby Chinese Community" or "Ruby Community (in|of) China"