From 211ce71400449c7e65cbef8ba9546418a20b3c8f Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 19 May 2014 12:06:09 +0200 Subject: Add GlobalID support for serialization --- test/models/person.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/models/person.rb (limited to 'test/models') diff --git a/test/models/person.rb b/test/models/person.rb new file mode 100644 index 0000000000..6e91e8b9a2 --- /dev/null +++ b/test/models/person.rb @@ -0,0 +1,19 @@ +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 + end +end \ No newline at end of file -- cgit v1.2.3