25 lines
619 B
Ruby
25 lines
619 B
Ruby
class Videolisting < ActiveRecord::Base
|
|
belongs_to :campaign
|
|
validates :videocode, presence: true, uniqueness: true
|
|
validates :voiceoverselection, presence: true
|
|
validates :musicselection, presence: true
|
|
after_save :send_notification_after_change
|
|
after_initialize :set_defaults
|
|
|
|
|
|
def set_defaults
|
|
self.producttypeid = 721
|
|
end
|
|
|
|
def asseturls_array
|
|
self.asseturls.split(',').collect { |url| { asseturl: url.strip } }
|
|
end
|
|
|
|
def send_notification_after_change
|
|
if self.published_changed? && self.published?
|
|
#TODO: SEND OUT EMAIL HERE TO CLIENT SERVICES REP
|
|
end
|
|
true
|
|
end
|
|
end
|