2014-04-07 18:41:34 +00:00
|
|
|
class Campaign < ActiveRecord::Base
|
2014-04-09 18:12:14 +00:00
|
|
|
has_many :videolistings, :dependent => :delete_all
|
2014-04-07 18:41:34 +00:00
|
|
|
accepts_nested_attributes_for :videolistings
|
2014-04-08 21:01:22 +00:00
|
|
|
validates :clientid, presence: true, uniqueness: true
|
2014-04-08 21:42:43 +00:00
|
|
|
validates :billingcode, uniqueness: true
|
|
|
|
validates :listingcode, presence: true, uniqueness: true
|
|
|
|
validates :advertisername, presence: true
|
|
|
|
validates :websiteurl, presence: true
|
2014-04-07 18:41:34 +00:00
|
|
|
end
|