vidpush/app/models/videolisting.rb

25 lines
619 B
Ruby
Raw Normal View History

2014-04-07 18:41:34 +00:00
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
2014-04-24 21:13:39 +00:00
after_initialize :set_defaults
2014-04-24 21:13:39 +00:00
def set_defaults
2014-04-24 16:51:50 +00:00
self.producttypeid = 721
end
2014-04-15 17:04:58 +00:00
def asseturls_array
2014-04-18 19:34:44 +00:00
self.asseturls.split(',').collect { |url| { asseturl: url.strip } }
2014-04-15 17:04:58 +00:00
end
def send_notification_after_change
2014-04-24 20:33:48 +00:00
if self.published_changed? && self.published?
#TODO: SEND OUT EMAIL HERE TO CLIENT SERVICES REP
end
2014-04-24 20:33:48 +00:00
true
end
2014-04-07 18:41:34 +00:00
end