docbrown/app/models/broadcast.rb
Mac Siri d976eb7ab6 Create InternalPolicy (#4380)
* Ensure verify_authorized in internal

* Create internal_policy

* Replace ArticlePolicy usage with InternalPolicy

* Replace BufferUpdate&CommentPolicy with InternalPolicy

* Remove verbose authorize_admin

* Forgot to remove coresponding specs

* Create specs for InternalPolicy

* Expand policy access on internal's broadcast

* Refactor

* Create shared spec

* Create request specs

* Add additional test cases
2019-10-17 14:21:43 -04:00

12 lines
341 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 Onboarding] }
def get_inner_body(content)
Nokogiri::HTML(content).at("body").inner_html
end
end