lib/webhook_system/subscription.rb in webhook_system-0.1.1 vs lib/webhook_system/subscription.rb in webhook_system-1.0.0
- old
+ new
@@ -6,9 +6,11 @@
validates :url, presence: true, url: { no_local: true }
validates :secret, presence: true
has_many :topics, class_name: 'WebhookSystem::SubscriptionTopic', dependent: :destroy
+ has_many :event_logs, class_name: 'WebhookSystem::EventLog', dependent: :destroy
+
accepts_nested_attributes_for :topics, allow_destroy: true
scope :active, -> { where(active: true) }
scope :for_topic, -> (topic) {
joins(:topics).where(WebhookSystem::SubscriptionTopic.table_name => { name: topic })