aboutsummaryrefslogblamecommitdiffstats
path: root/activemodel/test/models/contact.rb
blob: 7bfc542afbc89dfa996c9a417f08c30ef949d46a (plain) (tree)
1
2
3
4
5
6
             
                            

                                 
                                                                     
 







                      


                                                          
 



                
                
      
     
   
class Contact
  extend ActiveModel::Naming
  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 pseudonyms
    nil
  end

  def persisted?
    id
  end
end