diff --git a/app/models/profile.rb b/app/models/profile.rb index e2c28c5..791810e 100644 --- a/app/models/profile.rb +++ b/app/models/profile.rb @@ -1,6 +1,14 @@ class Profile < ApplicationRecord has_many :posts + has_many :outgoing_followships, + class_name: 'Followship', + foreign_key: :subject_profile_id + + has_many :incoming_followships, + class_name: 'Followship', + foreign_key: :object_profile_id + def full_name [first_name, last_name].map(&:presence).compact.join(' ').presence || "Profile#{" ##{id}" if id.present?}"