![class Plans::Event < ApplicationRecord belongs_to :plan belongs_to :organization belongs_to :actor, class_name: "User", optional: true belongs_to :record, polymorphic: true, optional: true SUPPORTED_ACTIONS = %w[ plan_created plan_viewed comment_added # ... ].freeze validates :action, inclusion: { in: SUPPORTED_ACTIONS, message: "%{value} is not a valid action" } after_create_commit :broadcast private def broadcast Hubspot::Timeline.new(self).post_later! CatchUp::Inbox.new(self).post_later! Slack::Inbox.new(self).post_later! Metrics::Inbox.new(self).calculate_later! Email::Inbox.new(self).post_later! end end](https://pbs.twimg.com/media/GTGA5uuW0AAk_5y.png?name=small&format=webp)
ALT class Plans::Event < ApplicationRecord belongs_to :plan belongs_to :organization belongs_to :actor, class_name: "User", optional: true belongs_to :record, polymorphic: true, optional: true SUPPORTED_ACTIONS = %w[ plan_created plan_viewed comment_added # ... ].freeze validates :action, inclusion: { in: SUPPORTED_ACTIONS, message: "%{value} is not a valid action" } after_create_commit :broadcast private def broadcast Hubspot::Timeline.new(self).post_later! CatchUp::Inbox.new(self).post_later! Slack::Inbox.new(self).post_later! Metrics::Inbox.new(self).calculate_later! Email::Inbox.new(self).post_later! end end
![class Plans::Event < ApplicationRecord belongs_to :plan belongs_to :organization belongs_to :actor, class_name: "User", optional: true belongs_to :record, polymorphic: true, optional: true SUPPORTED_ACTIONS = %w[ plan_created plan_viewed comment_added # ... ].freeze validates :action, inclusion: { in: SUPPORTED_ACTIONS, message: "%{value} is not a valid action" } after_create_commit :broadcast private def broadcast Hubspot::Timeline.new(self).post_later! CatchUp::Inbox.new(self).post_later! Slack::Inbox.new(self).post_later! Metrics::Inbox.new(self).calculate_later! Email::Inbox.new(self).post_later! end end](https://pbs.twimg.com/media/GTGA5uuW0AAk_5y.png?name=small&format=webp)
ALT class Plans::Event < ApplicationRecord belongs_to :plan belongs_to :organization belongs_to :actor, class_name: "User", optional: true belongs_to :record, polymorphic: true, optional: true SUPPORTED_ACTIONS = %w[ plan_created plan_viewed comment_added # ... ].freeze validates :action, inclusion: { in: SUPPORTED_ACTIONS, message: "%{value} is not a valid action" } after_create_commit :broadcast private def broadcast Hubspot::Timeline.new(self).post_later! CatchUp::Inbox.new(self).post_later! Slack::Inbox.new(self).post_later! Metrics::Inbox.new(self).calculate_later! Email::Inbox.new(self).post_later! end end























