osem-fcy/app/models/contact.rb

12 lines
459 B
Ruby
Raw Normal View History

2014-07-31 18:49:46 +02:00
class Contact < ActiveRecord::Base
attr_accessible :conference_id, :social_tag, :email, :facebook, :googleplus, :twitter, :instagram, :public
2014-07-31 18:49:46 +02:00
belongs_to :conference
validates :conference, presence: true
# Conferences only have one contact
validates :conference_id, uniqueness: {message: "has already contact details"}
validates :facebook, :twitter, :googleplus, :instagram,
format: URI::regexp(%w(http https)), allow_blank: true
2014-07-31 18:49:46 +02:00
end