2007-09-20 19:22:30 -04:00
|
|
|
class Contact < ActiveRecord::Base
|
|
|
|
# mock out self.columns so no pesky db is needed for these tests
|
|
|
|
def self.column(name, sql_type = nil, options = {})
|
|
|
|
@columns ||= []
|
|
|
|
@columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, options[:default], sql_type.to_s, options[:null])
|
|
|
|
end
|
|
|
|
|
|
|
|
column :name, :string
|
|
|
|
column :age, :integer
|
|
|
|
column :avatar, :binary
|
|
|
|
column :created_at, :datetime
|
|
|
|
column :awesome, :boolean
|
|
|
|
column :preferences, :string
|
2008-01-18 02:27:03 -05:00
|
|
|
|
2007-09-20 19:22:30 -04:00
|
|
|
serialize :preferences
|
2010-04-29 20:39:52 -04:00
|
|
|
|
|
|
|
belongs_to :alternative, :class_name => 'Contact'
|
|
|
|
end
|