aboutsummaryrefslogblamecommitdiffstats
path: root/test/models/person.rb
blob: a5bdbc462b1bf65cfb3f23a82f16698ecab34df2 (plain) (tree)
1
2
3
4
5
6
7
8
9
10



                                            
 
                 
 


                   
 


                    
 
                      
                                                                 
     
   
require 'active_model/global_identification'

class Person
  include ActiveModel::GlobalIdentification

  attr_reader :id

  def self.find(id)
    new(id)
  end

  def initialize(id)
    @id = id
  end

  def ==(other_person)
    other_person.is_a?(Person) && id.to_s == other_person.id.to_s
  end
end