Implement more embed code
Supported Media Files: - Youtube - Vimeo - Instagram - Flickr - Slidershare - Speakerdeck close #26
This commit is contained in:
parent
587126218d
commit
cbb4b40bc0
6 changed files with 54 additions and 12 deletions
|
|
@ -1,7 +1,7 @@
|
|||
class Event < ActiveRecord::Base
|
||||
include ActiveRecord::Transitions
|
||||
has_paper_trail
|
||||
attr_accessible :title, :subtitle, :abstract, :description, :event_type_id, :people_attributes, :person, :proposal_additional_speakers, :track_id, :video_id, :video_type, :require_registration, :difficulty_level_id
|
||||
attr_accessible :title, :subtitle, :abstract, :description, :event_type_id, :people_attributes, :person, :proposal_additional_speakers, :track_id, :media_id, :media_type, :require_registration, :difficulty_level_id
|
||||
|
||||
acts_as_commentable
|
||||
|
||||
|
|
@ -25,10 +25,16 @@ class Event < ActiveRecord::Base
|
|||
accepts_nested_attributes_for :people
|
||||
before_create :generate_guid
|
||||
|
||||
def self.media_types
|
||||
media_types = {:youtube => 'YouTube', :slideshare => 'SlideShare', :flickr => 'Flickr', :vimeo => 'Vimeo', :speakerdeck => 'Speakerdeck', :instagram => 'Instagram'}
|
||||
return media_types
|
||||
end
|
||||
|
||||
validate :abstract_limit
|
||||
validate :biography_exists
|
||||
validates :title, :presence => true
|
||||
validates :abstract, :presence => true
|
||||
validates :media_type, inclusion: {in: self.media_types.values}
|
||||
|
||||
scope :confirmed, where(:state => "confirmed")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue