There is a User model:
has_many :shipments, dependent: :destroy has_many :friendships has_many :friends, through: :friendships has_many :inverse_friendships, :class_name => 'Friendship', :foreign_key => 'friend_id' has_many :inverse_friends, :through => :inverse_friendships, :source => :user Friendship model:
belongs_to :user belongs_to :friend, :class_name => 'User' Shipment model:
belongs_to :user How to make it so that a user (User) creating a Shipment object could select one user from the list of friends and attach it to the Shipment model?
For example: User-1 (User) creates a model (Shipment) and attaches to it his friend (Friendship) User-2 (User) - which he selects from the drop-down list of his friends.