diff options
author | Larry Lv <larrylv1990@gmail.com> | 2014-05-20 01:36:41 +0800 |
---|---|---|
committer | Larry Lv <larrylv1990@gmail.com> | 2014-05-20 01:36:41 +0800 |
commit | 6198978fa23e7acc22bc0196db9315a60bea52d0 (patch) | |
tree | f0a4526cc755f05a55c3e0b1edf5419012fb8c2f | |
parent | ec47b52b24a3d20965cac7b074f16af3783295a0 (diff) | |
download | rails-6198978fa23e7acc22bc0196db9315a60bea52d0.tar.gz rails-6198978fa23e7acc22bc0196db9315a60bea52d0.tar.bz2 rails-6198978fa23e7acc22bc0196db9315a60bea52d0.zip |
Make tests for `Person` pass.
-rw-r--r-- | test/models/person.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/models/person.rb b/test/models/person.rb index fb12c1c614..a5bdbc462b 100644 --- a/test/models/person.rb +++ b/test/models/person.rb @@ -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 |