vidpush/app/models/campaign.rb
2014-04-22 11:02:40 -04:00

18 lines
569 B
Ruby

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