diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-19 14:48:26 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-05-19 14:48:26 -0300 |
commit | 08d860079e693325e9031cf47019d9371499652b (patch) | |
tree | f0a4526cc755f05a55c3e0b1edf5419012fb8c2f /test/models/person.rb | |
parent | ec47b52b24a3d20965cac7b074f16af3783295a0 (diff) | |
parent | 6198978fa23e7acc22bc0196db9315a60bea52d0 (diff) | |
download | rails-08d860079e693325e9031cf47019d9371499652b.tar.gz rails-08d860079e693325e9031cf47019d9371499652b.tar.bz2 rails-08d860079e693325e9031cf47019d9371499652b.zip |
Merge pull request #30 from larrylv/patch-3
Make tests for `Person` pass.
Diffstat (limited to 'test/models/person.rb')
-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 |