class Friend < ApplicationRecord has_many :attendents has_many :parties, through: :attendents validates :firstname, :lastname, :email, :telefon, presence: true def fullname [ firstname, lastname ].join(' ') end end