]> git.openstreetmap.org Git - rails.git/blob - app/models/friendship.rb
Create an ApplicationRecord for models to inherit from
[rails.git] / app / models / friendship.rb
1 # == Schema Information
2 #
3 # Table name: friends
4 #
5 #  id             :bigint(8)        not null, primary key
6 #  user_id        :bigint(8)        not null
7 #  friend_user_id :bigint(8)        not null
8 #
9 # Indexes
10 #
11 #  friends_user_id_idx  (user_id)
12 #  user_id_idx          (friend_user_id)
13 #
14 # Foreign Keys
15 #
16 #  friends_friend_user_id_fkey  (friend_user_id => users.id)
17 #  friends_user_id_fkey         (user_id => users.id)
18 #
19
20 class Friendship < ApplicationRecord
21   self.table_name = "friends"
22
23   belongs_to :befriender, :class_name => "User", :foreign_key => :user_id
24   belongs_to :befriendee, :class_name => "User", :foreign_key => :friend_user_id
25 end