mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-07 12:53:27 +08:00
## Description Add ability for House Ads to target ember routes in addition to categories and groups ## Extra Details - Ads new dropdown in House Ad manager page for pages/routes - New site setting to enable/disable this behavior - Original behavior should be observed if setting is disabled
27 lines
634 B
Ruby
27 lines
634 B
Ruby
# frozen_string_literal: true
|
|
|
|
module AdPlugin
|
|
class HouseAdRoute < ActiveRecord::Base
|
|
self.table_name = "ad_plugin_house_ads_routes"
|
|
|
|
belongs_to :house_ad, class_name: "AdPlugin::HouseAd", foreign_key: "ad_plugin_house_ad_id"
|
|
|
|
validates :route_name, presence: true
|
|
end
|
|
end
|
|
|
|
# == Schema Information
|
|
#
|
|
# Table name: ad_plugin_house_ads_routes
|
|
#
|
|
# route_name :string not null
|
|
# ad_plugin_house_ad_id :bigint not null
|
|
#
|
|
# Indexes
|
|
#
|
|
# index_house_ads_pages (ad_plugin_house_ad_id,route_name) UNIQUE
|
|
#
|
|
# Foreign Keys
|
|
#
|
|
# fk_rails_... (ad_plugin_house_ad_id => ad_plugin_house_ads.id)
|
|
#
|