aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-19 14:48:26 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2014-05-19 14:48:26 -0300
commit08d860079e693325e9031cf47019d9371499652b (patch)
treef0a4526cc755f05a55c3e0b1edf5419012fb8c2f
parentec47b52b24a3d20965cac7b074f16af3783295a0 (diff)
parent6198978fa23e7acc22bc0196db9315a60bea52d0 (diff)
downloadrails-08d860079e693325e9031cf47019d9371499652b.tar.gz
rails-08d860079e693325e9031cf47019d9371499652b.tar.bz2
rails-08d860079e693325e9031cf47019d9371499652b.zip
Merge pull request #30 from larrylv/patch-3
Make tests for `Person` pass.
-rw-r--r--test/models/person.rb10
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