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.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/test/models/user.rb b/activerecord/test/models/user.rb
index 47649e0a77..5089a795f4 100644
--- a/activerecord/test/models/user.rb
+++ b/activerecord/test/models/user.rb
@@ -5,8 +5,12 @@ class User < ActiveRecord::Base
has_secure_token :auth_token
has_and_belongs_to_many :jobs_pool,
- class_name: Job,
+ 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