mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
18 lines
589 B
Ruby
18 lines
589 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Contact < ApplicationRecord
|
|
has_paper_trail on: [:update], ignore: [:updated_at], meta: { conference_id: :conference_id }
|
|
|
|
belongs_to :conference
|
|
|
|
validates :conference, presence: true
|
|
# Conferences only have one contact
|
|
validates :facebook, :twitter, :googleplus, :instagram, :mastodon,
|
|
format: URI::regexp(%w(http https)), allow_blank: true
|
|
|
|
def has_social_media?
|
|
return true if facebook.present? || twitter.present? || googleplus.present? || instagram.present? || mastodon.present? || email.present?
|
|
|
|
false
|
|
end
|
|
end
|