aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/pet.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models/pet.rb')
-rw-r--r--activerecord/test/models/pet.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/test/models/pet.rb b/activerecord/test/models/pet.rb
index f7970d7aab..9bda2109e6 100644
--- a/activerecord/test/models/pet.rb
+++ b/activerecord/test/models/pet.rb
@@ -1,9 +1,14 @@
+# frozen_string_literal: true
+
class Pet < ActiveRecord::Base
attr_accessor :current_user
self.primary_key = :pet_id
- belongs_to :owner, :touch => true
+ belongs_to :owner, touch: true
has_many :toys
+ has_many :pet_treasures
+ has_many :treasures, through: :pet_treasures
+ has_many :persons, through: :treasures, source: :looter, source_type: "Person"
class << self
attr_accessor :after_destroy_output