1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Make tests for Person pass.

This commit is contained in:
Larry Lv 2014-05-20 01:36:41 +08:00
parent ec47b52b24
commit 6198978fa2

View file

@ -2,18 +2,18 @@ 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 == other_person.id
other_person.is_a?(Person) && id.to_s == other_person.id.to_s
end
end