vidpush/app/models/campaign.rb
2014-04-24 14:09:21 -04:00

21 lines
562 B
Ruby

class Campaign < ActiveRecord::Base
has_many :videolistings, :dependent => :delete_all
accepts_nested_attributes_for :videolistings,:reject_if => :all_blank, :allow_destroy => true
validates :listingcode, presence: true, uniqueness: true
validates :advertisername, presence: true
validates :websiteurl, presence: true
validates :description, presence: true
validates :productsandservices, presence: true
def init
self.clientid = 720
end
after_create :send_to_better_video
def send_to_better_video
#TODO Make API Calls
end
end