Add social url to conference

This commit is contained in:
Gopesh Tulsyan 2014-06-13 00:20:18 +05:30
parent 4e7dd5a8a7
commit 6d2576421b
4 changed files with 22 additions and 2 deletions

View file

@ -2,6 +2,8 @@
# This class represents a conference
class Conference < ActiveRecord::Base
require 'uri'
attr_accessible :title, :short_title, :social_tag, :contact_email, :timezone, :html_export_path,
:start_date, :end_date, :rooms_attributes, :tracks_attributes, :dietary_choices_attributes,
:use_dietary_choices, :use_supporter_levels, :supporter_levels_attributes, :social_events_attributes,
@ -12,7 +14,8 @@ class Conference < ActiveRecord::Base
:media_id, :media_type, :color, :description,
:registration_description, :ticket_description,
:sponsorship_levels_attributes,
:sponsors_attributes
:sponsors_attributes, :facebook_url,
:google_url, :twitter_url
has_paper_trail
@ -65,6 +68,10 @@ class Conference < ActiveRecord::Base
:social_tag,
:start_date,
:end_date
validates :facebook_url, :twitter_url, :google_url,
format: URI::regexp(%w(http https)), allow_blank: true
validates_uniqueness_of :short_title
validates_format_of :short_title, :with => /\A[a-zA-Z0-9_-]*\z/
before_create :generate_guid