Files
rails/activemodel/test/models/contact.rb
2010-04-30 13:19:30 +02:00

22 lines
337 B
Ruby

class Contact
include ActiveModel::Conversion
attr_accessor :id, :name, :age, :created_at, :awesome, :preferences
def social
%w(twitter github)
end
def network
{:git => :github}
end
def initialize(options = {})
options.each { |name, value| send("#{name}=", value) }
end
def persisted?
id
end
end