osem-fcy/app/models/contact.rb
2016-05-02 16:06:27 +02:00

13 lines
424 B
Ruby

class Contact < ActiveRecord::Base
belongs_to :conference
validates :conference, presence: true
# Conferences only have one contact
validates :facebook, :twitter, :googleplus, :instagram,
format: URI::regexp(%w(http https)), allow_blank: true
def has_social_media?
return true if !facebook.blank? || !twitter.blank? || !googleplus.blank? || !instagram.blank? || !email.blank?
false
end
end