diff options
Diffstat (limited to 'activejob/test/models')
-rw-r--r-- | activejob/test/models/person.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/activejob/test/models/person.rb b/activejob/test/models/person.rb new file mode 100644 index 0000000000..76a8f40616 --- /dev/null +++ b/activejob/test/models/person.rb @@ -0,0 +1,20 @@ +class Person + class RecordNotFound < StandardError; end + + include GlobalID::Identification + + attr_reader :id + + def self.find(id) + raise RecordNotFound.new("Cannot find person with ID=404") if id.to_i==404 + new(id) + end + + def initialize(id) + @id = id + end + + def ==(other_person) + other_person.is_a?(Person) && id.to_s == other_person.id.to_s + end +end |