]> git.openstreetmap.org Git - rails.git/blob - app/models/follow.rb
Merge pull request #6394 from openstreetmap/dependabot/github_actions/ruby/setup...
[rails.git] / app / models / follow.rb
1 # frozen_string_literal: true
2
3 # == Schema Information
4 #
5 # Table name: friends
6 #
7 #  id             :bigint           not null, primary key
8 #  user_id        :bigint           not null
9 #  friend_user_id :bigint           not null
10 #  created_at     :datetime
11 #
12 # Indexes
13 #
14 #  index_friends_on_user_id_and_created_at  (user_id,created_at)
15 #  user_id_idx                              (friend_user_id)
16 #
17 # Foreign Keys
18 #
19 #  friends_friend_user_id_fkey  (friend_user_id => users.id)
20 #  friends_user_id_fkey         (user_id => users.id)
21 #
22
23 class Follow < ApplicationRecord
24   self.table_name = "friends"
25
26   belongs_to :follower, :class_name => "User", :foreign_key => :user_id, :inverse_of => :follows
27   belongs_to :following, :class_name => "User", :foreign_key => :friend_user_id, :inverse_of => :follows
28 end