2014-07-31 18:49:46 +02:00
|
|
|
class Contact < ActiveRecord::Base
|
|
|
|
|
belongs_to :conference
|
|
|
|
|
|
|
|
|
|
validates :conference, presence: true
|
|
|
|
|
# Conferences only have one contact
|
2014-07-31 20:09:38 +02:00
|
|
|
validates :facebook, :twitter, :googleplus, :instagram,
|
|
|
|
|
format: URI::regexp(%w(http https)), allow_blank: true
|
2014-11-21 13:22:20 +01:00
|
|
|
|
|
|
|
|
def has_social_media?
|
2016-08-06 00:57:07 +02:00
|
|
|
return true if facebook.present? || twitter.present? || googleplus.present? || instagram.present? || email.present?
|
2014-11-21 13:22:20 +01:00
|
|
|
false
|
|
|
|
|
end
|
2014-07-31 18:49:46 +02:00
|
|
|
end
|