discourse/plugins/discourse-adplugin/app/models/ad_plugin/house_ad_route.rb
Bannon Tanner 91bcd2a35d
Feature page routes for house ads (#36932)
## 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
2026-01-12 11:25:46 -06:00

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)
#