ActiveRecord - 進階功能
單一表格繼承STI(Single-table inheritance)
class Contact < ActiveRecord::Base
validates_presence_of :name
end
class Company < Contact
end
class Person < Contact
end
contact = Person.create( :name => "ihower")
contact.type # "Person"交易Transactions
序列化Serialize
Store
Last updated