docbrown/app/models/broadcast.rb
Vaidehi Joshi 3f8961a299
Remove onboarding type broadcasts (#7067) [deploy]
Also clean up some pending comments.
2020-04-03 13:11:49 -07:00

14 lines
383 B
Ruby

class Broadcast < ApplicationRecord
resourcify
has_many :notifications, as: :notifiable, inverse_of: :notifiable
validates :title, :type_of, :processed_html, presence: true
validates :type_of, inclusion: { in: %w[Announcement Welcome] }
scope :active, -> { where(active: true) }
def get_inner_body(content)
Nokogiri::HTML(content).at("body").inner_html
end
end