aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/models/user.rb')
-rw-r--r--activerecord/test/models/user.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/models/user.rb b/activerecord/test/models/user.rb
index c099c57e37..5089a795f4 100644
--- a/activerecord/test/models/user.rb
+++ b/activerecord/test/models/user.rb
@@ -7,6 +7,10 @@ class User < ActiveRecord::Base
has_and_belongs_to_many :jobs_pool,
class_name: "Job",
join_table: "jobs_pool"
+
+ has_one :family_tree, -> { where(token: nil) }, foreign_key: "member_id"
+ has_one :family, through: :family_tree
+ has_many :family_members, through: :family, source: :members
end
class UserWithNotification < User