osem-fcy/spec/factories/commercials.rb

30 lines
711 B
Ruby
Raw Normal View History

# frozen_string_literal: true
2021-02-20 09:57:27 -08:00
# == Schema Information
#
# Table name: commercials
#
# id :bigint not null, primary key
# commercial_type :string
# commercialable_type :string
# url :string
# created_at :datetime
# updated_at :datetime
# commercial_id :string
# commercialable_id :integer
#
2014-08-12 11:51:59 +03:00
FactoryBot.define do
2014-08-12 11:51:59 +03:00
factory :commercial do
sequence(:url) { |n| "https://www.youtube.com/watch?v=4VrhlyIgo3M&factory=#{n}" }
factory :conference_commercial do
association :commercialable, factory: :conference
end
factory :event_commercial do
association :commercialable, factory: :event
end
2014-08-12 11:51:59 +03:00
end
end